Subscribe

SQLServer-DBA.com Links

Subscribe to newsletter

Dba_db2_button

Powered by TypePad
Sp_updatestats RESAMPLE option

22 March,2013 by Jack Vamvas

sp_updatestats  executes UPDATE STATISTICS against all the tables on a database, that require an update. Sp_updatestats accepts the @resample argument. This forces the UPDATE STATISTICS resample option.

Using  RESAMPLE updates the statistics based on the latest sample rate.  To view the latest sample rate use the DBCC SHOW STATISTICS command.

 

 

 
use db_name
go
DBCC SHOW_STATISTICS('a_table',a_statistic)

 

If RESAMPLE is not used , UPDATE STATISTICS based on a sample default rate. The sample default rate is determined by SQL Server . 

Deciding on which method to use is dependant on the level of granular control required.

Read More

SQL Server - Find last time STATISTICS updated - update statistics

Cannot create or update statistics on view because both FULLSCAN and NORECOMPUTE options are required

CREATE INDEX and STATISTICS_NORECOMPUTE

Filtered statistics, T-SQL best practises for T-SQL Tuesday

 

 


Author: Jack Vamvas (http://www.sqlserver-dba.com)

******** *******

Subscribe to SQLServer-DBA.com

Latest posts delivered to you daily

Delivered by FeedBurner

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment


sqlserver-dba.com | SQL Server Performance Tuning | SQL Server DBA:Everything | FAQ | Contact|Copyright & Disclaimer