• Smaller table on the test server? A build or rebuild of an index needs the full size of that index as free space, more if sort in tempDB is not on

    I was looking at available space, that shrunk less than the 140GB. Because there must have had available space in the mdf file that it probably used before expanding the file. I was initially confused by that.

    Err... so you want to reduce the free space in the database because the index build is running out of space? A little counter-productive perhaps...

    That's like saying that 6 litres of water doesn't fit into a 5 litre bucket, so use a 4 litre bucket instead.

    If some operation runs out of space, you need to grow the file, increase the free space in the file, not shrink it and remove all the free space.

    Yes, I understand now, there is no need for shrinking. Which was proven also by re-creating the index on test - the inital mdf file expansion which happened during the aborted index creation was sufficient for re-recreating the index (it did not expand again). Which makes me think I have enough room in production to creat that index this weekend. Looking at the database properties, it says it has 110GB available, and I have 105GB available on the disk partition. Is it safe to assume that having a total of 215GB available, I will have enough room to create that clustered index (144GB)? I believe the database properties shows total space available, including the transaction log file (about 30GB), which means I have (ideally) 215 - 30 = 185 GB available (since I don't intend to shrink the log file). Am I right? Thanks for your help!