Home Forums SQL Server 2012 SQL 2012 - General Alter index at same time as updte statistics caused deadlock - recommendations RE: Alter index at same time as updte statistics caused deadlock - recommendations

  • Actually, it may not be a futile exercise.  I do agree that rebuilding the indexes to reenable them will rebuilt the stats for those indexes but that will not include the Clustered Index nor any of the column stats.  Those will also be important after a major load and the major load may not be large enough to trigger a stats update on its own.

    Just to show how important it can be, we just went through this a couple of weeks ago with one of our larger tables.  Imported 200,000 rows for a new client and rebuilt the non clustered indexes..  Queries for clients of similar size executed in about a second.  Queries for the new client had to be stopped after an hour.  We did this a couple of times just to be sure.  Then, we rebuilt the all the stats on the table and the query for the new client became as speedy as the rest.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)