June 22, 2011 at 11:35 am
Hello Fellas, In my execution plan I can see clustered index seek for one table with only showing Object and Seek Predicates. Statistics are updated. Still it shows estimated number of rows as 1 and actual number of rows in thousands.
June 22, 2011 at 11:48 am
Post the plan
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 22, 2011 at 12:03 pm
Hello Gail. Somehow it's not possible for me to post execution plan. 🙁
Though i know it is hard to predict but I will be thankful if you could tell me few possible reasons for this behaviour.
June 22, 2011 at 12:11 pm
If I had to guess, your version of management studio is pre SP2 and what you think is a clustered index scan is a key lookup. Key lookups are always done a row at a time (that's why they're so bad).
And this: http://sqlinthewild.co.za/index.php/2009/09/22/estimated-rows-actual-rows-and-execution-count/
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 22, 2011 at 1:09 pm
I am not sure about pre SP2 thing but definitely it is clustered index seek and not scan.
June 22, 2011 at 1:51 pm
I'm almost willing to take a bet that if you check the version of SSMS (not the server) it'll be 2005 RTM. So many people forget they have to patch the client tools as well as the servers.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 22, 2011 at 2:17 pm
Sorry if it sounds stupid gail bu how can I check if SSMS will be 2005 RTM
June 22, 2011 at 2:34 pm
Help->About (as with most Windows apps)
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 22, 2011 at 3:27 pm
It shows 9.00.1399.00 for SQL Server 2005 Management Studio.
June 23, 2011 at 12:44 am
2005 RTM. (I should have taken the bet)
Patch it to the same level as your servers, then you'll see (likely) a key lookup, not a clustered index seek (which is what that really is)
There will still be the difference between actual and estimated rows, go read the blog post I referenced to see why (it's correct, not a misestimate)
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 23, 2011 at 7:27 am
Is the table a part of a join? Is it the bottom part of a Loop join perhaps? How many executions are there? Does that equal the number of rows?
"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
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply