SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SQL Server Backups & Maintenance - Best Practices


SQL Server Backups & Maintenance - Best Practices

Author
Message
GilaMonster
GilaMonster
SSC Guru
SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)

Group: General Forum Members
Points: 86461 Visits: 45237
John Mitchell-245523 (7/18/2013)
(3) The statistics update automatically triggered by ALTER INDEX REBUILD is based on a limited scan of the data, whereas UPDATE STATISTICS is based on a full scan.


Other way around.

When an index rebuild is run, the statistics on that index are updated with fullscan as part of the index rebuild process. It's not that the rebuild is triggering an automatic update, it's not. The update is part and parcel of the index rebuild operation.
On larger tables, UPDATE STATISTICS is sampled unless WITH FULLSCAN is specified. The details of what constitutes large and the sample rates are detailed in Books Online.

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

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


John Mitchell-245523
John Mitchell-245523
SSChampion
SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)

Group: General Forum Members
Points: 13957 Visits: 15934
GilaMonster (7/18/2013)

Other way around.

When an index rebuild is run, the statistics on that index are updated with fullscan as part of the index rebuild process. It's not that the rebuild is triggering an automatic update, it's not. The update is part and parcel of the index rebuild operation.
On larger tables, UPDATE STATISTICS is sampled unless WITH FULLSCAN is specified. The details of what constitutes large and the sample rates are detailed in Books Online.

Gail is right. I must have been thinking about partitioned indexes, and that only applies in SQL Server 2012 anyway. And I was mostly wrong about UPDATE STATISTICS, so please ignore my third point!

John
Jeffrey Williams 3188
Jeffrey Williams 3188
SSCertifiable
SSCertifiable (7.6K reputation)SSCertifiable (7.6K reputation)SSCertifiable (7.6K reputation)SSCertifiable (7.6K reputation)SSCertifiable (7.6K reputation)SSCertifiable (7.6K reputation)SSCertifiable (7.6K reputation)SSCertifiable (7.6K reputation)

Group: General Forum Members
Points: 7639 Visits: 9966
Andrew Pruski (7/17/2013)
Sorry but an update of the statistics is necessary as a rebuild index will not update the statistics on non indexed columns.

Andrew


Correct - however, it is rather wasteful to update statistics for index statistics that have just been updated due to an index rebuild. And, if you are not careful - you end up with a sampling rate instead of the recently built full scan.

Depending on the system, the maintenance window, etc... I will usually setup a process to rebuild all indexes weekly, and follow that with a task to update column statistics only with a full scan. That is usually good enough for the smaller systems I manage.

For larger systems, it gets much more complicated...

Jeffrey Williams
Problems are opportunities brilliantly disguised as insurmountable obstacles.

How to post questions to get better answers faster
Managing Transaction Logs

Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search