I had previously blogged about working on a SQL job that deleted data older than 13 months. Today I thought I would follow up with the database and check to see how much space was available in the database. So I ran a disk usage report out of SSMS and got the following result:

difference in space

Wait, what?

I was looking at the report and trying to decipher what the difference is between unused space and unallocated space. It’s not very intuitive is it? My OCD was going to let this go, so I started Googling. What I found was a lot of confusion over the matter until I found this forum post on MSDN.

Essentially the difference between unused and unallocated is this:

Unallocated – free space in side the data file. (what we think of)

Unused – empty space/extents that are reserved for an object.

I couldn’t understand how I would have empty space in an object after I had removed data. Then it dawned on me, it is most likely space reserved in the indexes that will be released when indexes are rebuilt.

Ok all and all, not that great of a revelation, but when you’re looking at the report it doesn’t make a lot of sense at a glance. Hey Microsoft, some kind of pie chart legend would be good here. Just saying.

Leave a Reply