August 9, 2011 at 9:55 am
I was looking at the execution plan of a query but I'm not able to understand why it's doing a clustered index scan instead of seek. What can i do to make it a seek?
August 9, 2011 at 9:56 am
Please post the actual execution plan and the query. We can't help without that.
In the meantime I can recommend this reading => http://sqlinthewild.co.za/index.php/2009/01/09/seek-or-scan
August 9, 2011 at 9:57 am
Can you post the execution plan with the query?
August 10, 2011 at 7:13 am
In general it's either the query, the statistics or the indexes. Take a look at the predicate values in the properties of the scan. It'll tell you what it's searching on.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
August 11, 2011 at 8:13 am
Most people don't understand that a seek isn't always more efficient than a scan, and can in fact be unbelievably LESS efficient. If you are hitting (or the optimizer estimates you will hit) more than a few percentage of the total rows in a table a scan quickly starts to be more efficient. Are you by chance either hitting a large percentage of rows in the table and/or doing a HASH join after this table scan?
I will chime in with the others about posting the query and the actual query plan for us to review so we can help you.
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply