Entry
one table contains 15 lakh records.After deleting all records also database size is not come down.why?
Jun 21st, 2005 08:15
George Boutwell, prasad,
The database allocates pages, where it stores those records for that
table. When you delete all the records in a table, it sets a flag on
the pages that contain the data indicating the page is available for
re-use, instead of deleting the page entirely. Since the pages aren't
deleted but reused and the pages take space, that is why the database
size does not come down. As an further experiment you can add data and
see that the DB size doesn't grow until a new page is needed to store
that data.
To get the database size to go back down, you would need to do an
backup and restore.