Rebuild index taking time

  • Question: rebuild index task in a SQL 2014 ENV is taking a long time to compete. what to check and suggest to make it run faster? This process also causing blocking to others. Thanks

  • pietlinden - Thursday, December 20, 2018 8:33 PM

    Lordy, don't use REORGANIZE.  It'll take longer, beat the hell out of the transaction log file, and do little except help the occasional read-ahead if something isn't already in memory.  See my 18 Apr 2018 comment on that thread.

    --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)

  • rinu philip - Thursday, December 20, 2018 6:20 PM

    Question: rebuild index task in a SQL 2014 ENV is taking a long time to compete. what to check and suggest to make it run faster? This process also causing blocking to others. Thanks

    I have a piece of string... how long is it? 😉

    A little more info would help.  For example, post the CREATE INDEX statement and the DDL for the table and tell us how many rows the table has.  We also need to know which edition of SQL Server you have.

    --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)

  • I’ll get the script and post it soon, thanks

  • Jeff Moden - Thursday, December 20, 2018 10:49 PM

    rinu philip - Thursday, December 20, 2018 6:20 PM

    Question: rebuild index task in a SQL 2014 ENV is taking a long time to compete. what to check and suggest to make it run faster? This process also causing blocking to others. Thanks

    I have a piece of string... how long is it? 😉

    A little more info would help.  For example, post the CREATE INDEX statement and the DDL for the table and tell us how many rows the table has.  We also need to know which edition of SQL Server you have.

    Actually the rebuild index script was being run by a developer and they have agreed to share the script with me, as soon as I get it I'll be posting it and the other requested information...thank you

  • RGP - Monday, January 7, 2019 11:11 AM

    Jeff Moden - Thursday, December 20, 2018 10:49 PM

    rinu philip - Thursday, December 20, 2018 6:20 PM

    Question: rebuild index task in a SQL 2014 ENV is taking a long time to compete. what to check and suggest to make it run faster? This process also causing blocking to others. Thanks

    I have a piece of string... how long is it? 😉

    A little more info would help.  For example, post the CREATE INDEX statement and the DDL for the table and tell us how many rows the table has.  We also need to know which edition of SQL Server you have.

    Actually the rebuild index script was being run by a developer and they have agreed to share the script with me, as soon as I get it I'll be posting it and the other requested information...thank you

    Just as a sidebar, index maintenance can take quite the toll on a server in more ways than one (MDF explosion, LDF explosion, possible TempDB explosion, unexpected larger T-Log backups, etc, etc, not to mention blocking if not done Online, which can cause larger file explosions.).  It's not a good idea for a Developer to run such a thing on a whim even in Dev even if it can be done in an online fashion.  Ask them to please contact the DBA (I assume that's you) for such activities.

    --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)

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

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