Sql-server – Database size increases after creating a partition

sql server

I have just partitioned an existing table.

The database size was 5GB with 14 million records prior to the partition operation. After the partition operation moved rows to the new FileGroup, I noticed the database size increased to 8GB.

Can someone explain why that happened?

Best Answer

One reason is that new data was allocated but old not cleared. This is partially because it is not available immediatly, the other reason may be that SQL Server has to wait until partitioning finishes to delete the old table. if you are considered by that (which I find funny - heck, it is even funny partitioning a very small table on a tiny database of 5gb) then you may shrink the file to reclaim the space. THAT SAID: perforamnce oriented databases should not autogrow to start with ;)