does reindexing automatically update statistics?

  • Does reindexing automatically update statistics? I know that creating a new index updates statistics, but I am not sure about dbcc reindex.

    Thanks.

  • I am using sql server 7.0 and 2000.

    thanks.

  • Reindexing does not update statistics. Use sp_updatestats, or turn on Auto Update Stats in the db properties. -JG


    -JG

  • Dont think I agree with you on that one JG. Perhaps I am wrong, but if you just rebuilt an index and kept the old stats you'd have a total mess. I agree that you can/should turn on the auto stats or could just run sp_updatestats to update them.

    Andy

  • If auto update statistics is on, will the statistics get updated when a reindex is done? I think the auto update statistics only kicks in when the data pages hits a certain level changes.

    thanks.

  • Might of miscommunicated on the last entry. I was trying to communicate that it is necessary to update the stats after rebuilding the index.

    richcoulson if you look in Books online under Auto Update Stats, it will have all the information on when an update occurs, and some good information of when it might not be a good idea to have them on.

    One last thing; Profile your database and capture some of the incomming calls. Then look through the trace for "Missing Column Statistics. All out-of-date and missing stats are captured in profiler.


    -JG

  • Personally I would use DBCC UPDATEUSAGE to clean up any inaccuracies in the sysindexes table.

  • If u run dbcc dbreindex and then run DBCC SHOW_STATISTICS u will see that the stats have been updated!

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply