SQL Myth – Indexes and small tables

I have often heard people say that indexes or primary keys (and their associated clustered indexes) are not needed on small tables.  I just had a performance issue with a query and found the culprit to be a relatively small table that did not have any primary key or any indexes.  The problem was the small table was being hit with a full table scan inside a nested loop.  By adding an index it significantly changed the query plan and as a result performance increased by 87%.

Advertisements
This entry was posted in Database Administration, Performance and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s