Results 1 to 6 of 6

Thread: Reindexing vs Update statistics

  1. #1
    Join Date
    Sep 2004
    Posts
    26

    Reindexing vs Update statistics

    Hi

    We are upgrading from sql 7 to 2000.During the upgrade process do we have to do a reindexing of all tables or will update statistics take care of that.

    Or do we have to do both?
    What is the difference between reindexing and update statistics.

    Thanks

    Madhukar Gole

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    Reindexing drops and creates the indexes, so it will take longer compared to update statistics, which only gathers information on indexes (does not change anything on the index).

    Reindexing is recommended if your index is fragmented or there were many inserts and deletes on the table and the index b-tree is skewed. That means it is occupying empty spaces on one side of the tree and continues to grow on other side.

    Use dbcc showcontig to check fragmentation.

  3. #3
    Join Date
    Feb 2003
    Posts
    1,048
    If you database is offline or at a low traffic point, run DBCC DBReindex. If your database is online and experiencing moderate traffic, run DBCC INDEXDEFRAG until you can take the database offline or the traffic is low.

    I have two high activity tables for which I run DBCC INDEXDEFRAG every 2 hours throughout the day. Then during the slowest time of the night, I run DBCC DBReindex once daily.

  4. #4
    Join Date
    Sep 2002
    Posts
    5,938
    Rebuilding index will update statistics as well.

  5. #5
    Join Date
    Sep 2004
    Posts
    26

    Update statistics

    Thanks for all your replies.
    Does the database have to be offline while performing update statistics?

    Mdhukar Gole

  6. #6
    Join Date
    Feb 2003
    Posts
    1,048
    No

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •