Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Analyzer
Posting Yak Master
115 Posts |
Posted - 2013-02-28 : 09:48:45
|
"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 advanceIf 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
1974 Posts |
Posted - 2013-03-09 : 18:18:01
|
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 |
|
|
|
|
|