Entry
one table contains 15 lakh records.After deleting all records also database size is not come down.why?
Nov 17th, 2008 23:21
John Martin, 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.
<a href='http://www.redhotwebhosting.co.uk' target=_blank><b>Red Hot Web
Hosting</b></a><br>Website design, hosting packages, adword and adsense
campaigns. Web Page Optimisation and consultancy help.<br><br>