Avonelle's Tech Blog

Go Back

How to Figure Out Why Your Database is HUGE

My customer's ASP.NET application database that went live on 7/1/08 has been growing at an alarming rate. I had to create a new 16 GB virtual drive in my VM just to restore it. Yikes! A lot of that was transaction log space, but the main database file was still quite large.

Since at this rate they'll run out of disk space sooner than we anticipated, I wanted to figure out where all the space was being used. So I discovered this great article with a cool stored procedure that shows me the physical disk space each table is using. That's when I discovered that one of my tables was taking up 270 MB.

This particular table is really a sort of temporary place for storing selections for printing on a report. I had no idea it would grow so fast, but that's okay. Records that are older than a day are no longer valid, so we will be using a nightly process that removes old records. That brought the size down to less than a MB. After shrinking the database, the database size is now under 50 MB.

Posted by Avonelle on Thursday, August 07, 2008.

Facebook Twitter