Why should I run update statistics after rebuilding the indexes on a table?

  • Hi everyone,

    To enhance the performance I was asked to run update statistics on a table with full scan after rebuilding the indexes. Aren't the statistics upto date once we rebuild the indexes? Is it necessary to update the statistics too after rebuilding the index?

    If I need to do both(rebuild index as well as update statistics), could someone please explain why do i need to do so?

    Thank you.

  • You shouldn't.

    What you may need to do is update the column statistics (ones not associated with indexes) as they would not have been updated by index rebuilds.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • My understanding is that the stats are updated only for the index that you rebuilt, not the columns "beside" the index.

    Can anyone confirm this?

  • Tx Gail... now that's quick service :w00t:.

  • I live to anticipate. 😀

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • GilaMonster (6/13/2011)


    I live to anticipate. 😀

    Must be all that martial arts training! Getting to the Jedi level now :w00t:.

  • Gail, don't you think it becomes really tough to write a query to update statistics if there are 200 columns.

    For example: I need to specify 197 columns in the update stats query if there are indexes on 3 columns. Am I correct? So is it better to just do update stats with full scan on the whole table rather mentioning all 197 columns?

  • sunny.tjk (6/13/2011)


    Gail, don't you think it becomes really tough to write a query to update statistics if there are 200 columns.

    For example: I need to specify 197 columns in the update stats query if there are indexes on 3 columns. Am I correct? So is it better to just do update stats with full scan on the whole table rather mentioning all 197 columns?

    It is fairly easy to do with a maintenance plan.

    In an update statistics maintenance plan task, you can specify that you want index statistics, column statistics, or both.

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

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