I have a database that is size about 104GB.
When I calculate the total table sizes in the database it's only about 24GB. This includes Data+index+unused spaces.
Why the DB size is too large?
|
I have a database that is size about 104GB. When I calculate the total table sizes in the database it's only about 24GB. This includes Data+index+unused spaces. Why the DB size is too large? |
|||
| show 5 more comments |
|
Depending on the RDBMS being used, it is possible that the large file size as compared to summed-up table sizes is caused by any or more than one of the following:
I'm not saying these are definite items that impact your situation. I just mean that these may occur, and not just in your situation..
|
|||||||
|
|
In one of your comments you said the initial size of the database is shown in SSMS as 101890MB. That's why the database is so large, it was created at that size. As to how/why it was created at 104GB, check the model database on that server. Good odds someone has fiddled with the defaults in model and your database has inherited those when you created it. |
|||
|
|
|
If you are talking about os file size versus computed bytes for the records you store, then this will depend on your database type. If you take Oracle as an example, you create tablespaces as containers for your tables and indexes. These tablespaces pre-allocate space on disk via data files. Then you start allocating blocks out of the tablespace for different tables until your tablespace is full. But you may not have even created a table yet but the os will have a file for the empty tablespace. Then you also have tablespaces for system tables, rollback information, journaling information and the like. So there is a certain amount of overhead before you even get into record counts. If you did a dump of your data tables, the files generated by the dump may be more closely related to your calculated data sizes. |
|||
|
deletemay be reused or not due to speed reasons; try coalescing some of the database objects to reclaim it. – 9000 Dec 22 '11 at 15:09