Droid-Bird
Droid-Bird

Reputation: 1505

why imported database is smaller in phpmyadmin?

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.

Upvotes: 2

Views: 451

Answers (1)

millimoose
millimoose

Reputation: 39950

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.

Upvotes: 2

Related Questions