Worried about disk space on rebuild

  • Hi,

    I am rebuilding all of my indexes this weekend and I am concerned about free disk space.

    I have started the rebuild process, and have noticed that the available disk space has not changed. I thought as it was rebuilding the indexes it would be consuming disk space, it's not.

    Does it not need the space until the very end of the rebuild? I can see it is running and rebuilding indexes..but not consuming disk space.

    I am not sorting in temp db (probably should have).

  • update - it is starting to consume some space.

    does it write it out as it goes? or does it wait until it's completely done to write out the indexes?

  • when rebuilding indexes, a new index is created then switched out with the existing index, which is then dropped. your space should only increase as much as your largest index.

    here is a simplistic example. If your data file is completely full at 10GB and you have three indexes to rebuild with sizes 1GB, 2GB, 3GB. when you rebuild the 1GB index, your data file will grow to 11GB. After the index rebuild you will have 1GB of free space in the file. then if you rebuild the 3GB index, your data file will grow to 13GB(1GB of free space used and 2GB of file growth). when that rebuild is complete, you will have 3GB of free space in the data file. last, you rebuild the 2GB index, and there will be no file growth as you have 3GB of free space which will accommodate the 2GB of space the index rebuild needs.

    your transaction log file will continue to grow, but not by the same amounts. If you were reorganizing instead of rebuilding, you would see little, if any, data file growth but lots of transaction log growth.

    Bob
    -----------------------------------------------------------------------------
    How to post to get the best help[/url]

  • Thanks Bob

Viewing 4 posts - 1 through 3 (of 3 total)

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