We Don't Need No Stinkin Indexes
-
Yet you didn't point out the double negative. :rolleyes:
Ah, but as a native speaker of American I can tell when a double negative is actually reenforcing the negativity rather than negating the negativity.
-
I just came across the main table in the SQL Server database that stores info for my company's website. It has 170,000 records... and no indexes. :wtf: I have just remedied that by putting a clustered index on the primary key. I'll have to keep a look out for code that queries that table by fields other than the primary key... may need to add more indexes.
I'm not very familiar with SQL Server but shouldn't the primary key always be indexed automatically? (at least this is true for Oracle databases)
-
I'm not very familiar with SQL Server but shouldn't the primary key always be indexed automatically? (at least this is true for Oracle databases)
Yes, I believe creating a primary key will create an index automatically. However, it was only a primary key by reputation, not because somebody made it a primary key. :)
-
Yes, I believe creating a primary key will create an index automatically. However, it was only a primary key by reputation, not because somebody made it a primary key. :)
AspDotNetDev wrote:
However, it was only a primary key by reputation, not because somebody made it a primary ke
Erm you have bigger problems than a lack of indices then, don't you :whistles:-)
Sort of a cross between Lawrence of Arabia and Dilbert.[^]
-Or-
A Dead ringer for Kate Winslett[^] -
AspDotNetDev wrote:
However, it was only a primary key by reputation, not because somebody made it a primary ke
Erm you have bigger problems than a lack of indices then, don't you :whistles:-)
Sort of a cross between Lawrence of Arabia and Dilbert.[^]
-Or-
A Dead ringer for Kate Winslett[^]Haha, so it would seem.
-
I just came across the main table in the SQL Server database that stores info for my company's website. It has 170,000 records... and no indexes. :wtf: I have just remedied that by putting a clustered index on the primary key. I'll have to keep a look out for code that queries that table by fields other than the primary key... may need to add more indexes.
I think the only clear solution is to take a step back from databases and go back to paper based systems. Much easier than adding a primary key, and will help create more jobs for the industry... WIN/WIN And, are you sure you didn't get fooled?
I may or may not be responsible for my own actions
-
I just came across the main table in the SQL Server database that stores info for my company's website. It has 170,000 records... and no indexes. :wtf: I have just remedied that by putting a clustered index on the primary key. I'll have to keep a look out for code that queries that table by fields other than the primary key... may need to add more indexes.
Big ouch. :~
-
I think the only clear solution is to take a step back from databases and go back to paper based systems. Much easier than adding a primary key, and will help create more jobs for the industry... WIN/WIN And, are you sure you didn't get fooled?
I may or may not be responsible for my own actions
-
I just came across the main table in the SQL Server database that stores info for my company's website. It has 170,000 records... and no indexes. :wtf: I have just remedied that by putting a clustered index on the primary key. I'll have to keep a look out for code that queries that table by fields other than the primary key... may need to add more indexes.
Whenever we need to evaluate a performance problem at a customer the first thing we do is look for a missing index. Usually, this is the result of a messed up database installation but sometimes the damn thing is just not there. This kind of problem, as shameful as it is, is actually quite common. I've seen this on tables with millions of rows - no performance problem there eh?
-
I just came across the main table in the SQL Server database that stores info for my company's website. It has 170,000 records... and no indexes. :wtf: I have just remedied that by putting a clustered index on the primary key. I'll have to keep a look out for code that queries that table by fields other than the primary key... may need to add more indexes.