title: When data deleted from mysql, what happens to space it took up?
body: <p>My understanding is (correct me if I'm wrong or inaccurate please) that when you delete data (say, a whole row) from a MySQL table, the file size of the database file does not shrink. If you had a 20Gb database and deleted 19Gb of data from it, you wouldn't have a 1Gb database file, it would still be 20Gb.</p>
  
  <p>What happens in the "space" within the file where the data used to be? Does it get replaced by empty data? Or does the deleted data remain in the file but is "flagged" as having been deleted and can't be seen any more by regular means like running a select query? If I add more data to the database, will it go in the space where old deleted data used to be, or will it always take up new space?</p>
  
  <p>For instance, in the example above, if I delete 19Gb from a 20Gb database, then add 5Gb of new data, will the database be 20Gb or 25Gb?</p>