I have created a table : Table1. Inserted 100 thousand rows and deleted. I did the same around 100 times ( inserting and deleting). Will it cause of increasing the database and table size every time? ( I am using Delete instead of Truncate).
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
migrated from stackoverflow.com Jan 19 '12 at 11:34
This question came from our site for professional and enthusiast programmers.
WHen you use delete the rows actually not deleted but marked as GHOST records, which will finally deleted by dedicated process named GHOST CLEANUP which works relatively slow in background
To force deletion of ghost records run:
No, actually deletion doesn't free data space instantly but marks corresponding data pages as free for that table. So when you insert data for the same table, those particular pages get filled up first. In any case, after a while the background process de-allocates the free pages and finally reduces the page size.
Here is a good article on this I think.