Inserting a row in a database adds up data to it. Does deleting a row free up space in that database? Or will the row just be deleted without changing the amount of used space?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For SQL, it depends on from whose standpoint. For example, if you can insert a million rows before running out of disk space, if you delete half of them, then you have space to insert a half million more again. (Ignoring transaction logging– just imagine that the logging is done elsewhere)
The data file, after it has grown, will not shrink. So the drive space used by the data file isn’t available to the OS or any other application. Until, a database shrink operation is done. That re-arranges the data inside the file to free up space on the drive for the OS or other application to use.