Problem with calculating an approximate space required for online index rebuild RRS feed

  • Question

  • I have a database called TestDB which is in simple recovery model. I performed index rebuild on my Test Server which has no other user transactions except me. Before an online index rebuild the sizes of mdf and ldf files were as below:

             total size          used             free
    mdf       13261 MB         13261 MB             0 MB
    ldf        9697 MB            25 MB          9672 MB

    After rebuilding of the largest index only with fragmentation percentage equivalent to 91% (size of index was approx 5858 MB) mdf and ldf files became as below:

             total size           used             free
    mdf       16854 MB          10061 MB         6792 MB
    ldf        9697 MB            363 MB         9334 MB

    The question is, if the size of the largest index was 5858 MB, and according to some books and resources on the internet which state that total size needed for rebuilding an index is equivalent to approx 120% of the largest index or maybe double size, then total size of mdf file after rebuilding should be just over 20000 MB, shouldn't it?

    I calculated that like 5858*120%=7029 MB, and finally as we do not have space in mdf file then autogrowth will happen and final size of mdf will be 13261 MB + 7029 MB = 20.29 GB.

    Sunday, November 24, 2019 8:47 PM

All replies