Showing posts with label index rebuild. Show all posts
Showing posts with label index rebuild. Show all posts

Sunday, July 28, 2013

STATISTICS_NORECOMPUTE in Rebuild Index


It specifies whether distribution statistics are recomputed. The default is OFF.
ON
Out-of-date statistics are not automatically recomputed.
OFF
Automatic statistics updating are enabled.

Indeed, statistics are recomputed during the index rebuild.

Dont think that it stops SQL Server from updating the statistics at the time of a rebuild; that is NOT what it does. 
Statistics are ALWAYS updated at the time of a REBUILD; this cannot be turned off (nor would you want to).

Instead, STATISTICS_NORECOMPUTE stops the database-wide auto-updating from updating the specific statistics for an index (or column-level statistic) that was created (or rebuilt) with this option turned on.

STATISTICS_NORECOMPUTE – When would anyone want to use it?


HTH

Monday, December 24, 2012

SQL Index Drop and Create Order


Always drop the Non Cluster Index first as it has reference to Cluster Index.
If Cluster Index was removed first, non Cluster Index would have to be updated on cluster index removal.
When you build index, first build the Cluster Index and then Non Cluster.

Note: All NON Cluster Indices can be build simultaneously once Cluster Index is created.

STATISTICS_NORECOMPUTE


During Index Rebuild, one of the parameters a user can set is Statistics_NoRecompute.
The default value is OFF which means "Automatic statistics updating are enabled"
ON = Out-of-date statistics are not automatically recomputed