07-31-2023, 09:36 AM
IF you only care about the empty wasted space in the database and not the individual tables you can consider the following:
If the database experiences large amount of data insertion and then deletions, maybe like in an ETL situation, this will cause too much unused space in the database as the file groups **auto-grows** but never auto-shrinks back.
You can see if this is the case by using the **Properties** page of your database. You can shrink (right click on the database > Tasks > Shrink) and claim some space back. But, if the underlying reason is still there, the database will grow back (and consume extra time trying to grow back and things gets slowed down until it grows enough - so don't do it in that case)
[![(KEK: key encryption key)][1]][1]
[1]:
If the database experiences large amount of data insertion and then deletions, maybe like in an ETL situation, this will cause too much unused space in the database as the file groups **auto-grows** but never auto-shrinks back.
You can see if this is the case by using the **Properties** page of your database. You can shrink (right click on the database > Tasks > Shrink) and claim some space back. But, if the underlying reason is still there, the database will grow back (and consume extra time trying to grow back and things gets slowed down until it grows enough - so don't do it in that case)
[![(KEK: key encryption key)][1]][1]
[1]: