Question

I have dumped a database using phpmyadmin and had 390MB and then imported it using command line into new database, then it showed the size 360.

Why this imported database is smaller? Thanks.

Was it helpful?

Solution

When you delete data from a database, the records usually aren't actually deleted from the database files, just marked as deleted – the space can be reused for new records later. When you export a database, these deleted records naturally aren't exported, or recreated when you import the database.

This reuse saves a little time when records are added, because you don't always have to make the file larger. And it saves a lot of time when deleting records – deleting something from the middle of a file involves shifting all the data that comes after it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top