SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 “Actual No. of Rows” Vs “Estimated (STATS)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Analyzer
Posting Yak Master

United Kingdom
102 Posts

Posted - 02/28/2013 :  09:48:45  Show Profile  Reply with Quote
"Script required" (lost copy I had from repository)

Hi. Have reason to believe a generic UPDATE STATISTICS maint script on clients site is not successfully working despite last 'date' correlating with job execution date. Think we discovered the sample rate was 0.01 rendering the updates pointless.

Does anyone have a script comparing Actual No. rows Vs Estimated rows? (see justification below) Thanks in advance

If these numbers are (consistently) fairly close, then most likely your statistics are up-to-date and used by the optimizer for the query. If not, time for you to re-check your statistics create/update frequency.

http://blog.idera.com/sql-server/understanding-sql-server-statistics/

chadmat
The Chadinator

USA
1974 Posts

Posted - 03/09/2013 :  18:18:01  Show Profile  Visit chadmat's Homepage  Reply with Quote
Yes, if you don't specify a sample rate, UPDATE STATISTICS will use a ridiculously low sample rate on large tables. I don't think you can access Actual rows vs Estimated rows unless you are capturing the query plan via trace. Not sure if there is an XEvent you could tap into. You can see your statistics with DBCC Show_Statistics and see the total rows vs. rows sampled and if it is a very low percentage, then you are likely getting very bad query plans.

-Chad
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.2 seconds. Powered By: Snitz Forums 2000