Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reindex and Update Stats Maintenance

Status
Not open for further replies.
Apr 18, 2002
185
US
I am setting up maintenance plans for a new database. When running DBCC Update Stats and DBCC DBReIndex on the database, which one should run first? Or does it matter?
 
It does matter. When indexes are rebuilt using DBCC DBREINDEX or the newer ALTER INDEX REBUILD syntax (SQL 2005) statistics are automatically updated. However, this is not the case when reorganizing indexes using DBCC INDEXDEFRAG or ALTER INDEX REORGANIZE. If you are doing an index reorganization rather than an index rebuild, you might find it useful to update the statistics after the process completes. Also,
I don't know what your schedule will be but I run update stats nightly and ALTER INDEX once a week. Usually indexes don't need to be rebuilt every day and most databases don't have the maint window during the week.

- Paul
- If at first you don't succeed, find out if the loser gets anything.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top