Lloyd Banks
Lloyd Banks

Reputation: 36659

Do indexes help tables with large number of columns but small number of records?

I am under the assumption that indexes help you find particular records based on hashing on a combination of 1 or more columns. If this is the case, then a large table with a lot of columns but few records will not benefit much from indexes. Is this correct?

Upvotes: 3

Views: 127

Answers (1)

Aaron Bertrand
Aaron Bertrand

Reputation: 280381

That's correct. On smaller tables (and depending on the query) it is going to be more efficient to just scan the whole table than to assemble the results based on a seek on a specific index and then a lookup to get the rest of the results.

There is no magic row count or other formula here, though. Too many variables to make a blanket statement. Just something you should be aware of.

Upvotes: 6

Related Questions