March 11, 2014 at 3:10 am
Hi guys,
There is a job running sp_updatestats over night. This appears to collect based on 0.3% of the table according to DBCC SHOW_STATISTICS:
Rows Rows Sampled
227608922678814
Why would it choose such a value by default? Can't this be altered in a way besides update statistics with sample size then sp_updatestats 'resample'?
Also, where can I find the sample rate of the most recent update? (what RESAMPLE considers) I'm guessing this isn't the sampled vs actual columns since that won't cover FULLSCAN on a growing table.
Thanks for any info.
March 11, 2014 at 4:39 am
sp_updatestats uses the defaults which is for SQL Server to make a calculation for which sample rate to use. If you need to take more direct control, you have to use UPDATE STATISTICS directly.
"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
March 11, 2014 at 4:55 am
OK thanks for the clarity. I guess I'll just add an extra step to fullscan on that particular table after doing an all-round sp_updatestats.
March 11, 2014 at 4:59 am
Dird (3/11/2014)
OK thanks for the clarity. I guess I'll just add an extra step to fullscan on that particular table after doing an all-round sp_updatestats.
Are you getting bad query plans against that table due to poor row estimates?
I'm a DBA.
I'm not paid to solve problems. I'm paid to prevent them.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply