DBCC Reindex Question

  • Hi,

    Can anyone let me know if DBCC Reidex update stats?

    Thanks

     

  • It doesn't do anything to your statistics, you'll have to run UPDATE STATISTICS or CREATE STATISTICS commands.

  • The dbcc dbreindex always updates the statistics.  You can confirm this yourself by running this simple test in the pubs database, and looking at the statistics date before and after the dbcc dbreindex

    use pubs
    select [Stats_Updated_Date] = stats_date(object_id('dbo.authors'),1)
    dbcc dbreindex ('dbo.authors','',0)
    select [Stats_Updated_Date] = stats_date(object_id('dbo.authors'),1)
    
     
  • Yes the DBCC DBREINDEX updates the statistics automatically. I have tested this.

    Thanks Michael for your help

  • Yes it will update stats....

  • what is difference between sql server 2000 and 2005 architecture

    send ans siva.meti@gmail.com plz

  • If you reindex do not forget the execute sp_recompile for the table(s) affected and sp_refreshview for the view(s) affected. otherwise you will have up to date statistics and stored procedure plans compiled with out of date statistics potentially causing you performance degredation.

    RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."

  • Right now I run Reindex on all tables and then update stats with fullscan?  Should I be running sp_recompile and sp_refreshview between those two jobs?  This is on sql server 2005.

  • Not totally sure on 2K5 but on 2K I can answer. That depends on the method of execution. If you do all table REINDEXES followed by all table UPDATE STATS you need to do this after each step. This is because you have a windows (database size and exeuction time are the variables) when the execution plans are not optimal.

     

    RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."

  • if you are using SQL 2005 better you use ALTER INDEX than DBCC DBREINDEX as it would be removed from future version, more over ALTER INDEX does provide online index rebuild, row & page lock options etc..etc.. check http://msdn2.microsoft.com/en-us/library/ms188388.aspx

      

    Regards
    Shrikant Kulkarni

Viewing 10 posts - 1 through 9 (of 9 total)

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