Mysqldump generated file that is smaller size then database [closed]
Solution 1:
- The dump does not include the
INDEXes
other than thePRIMARY KEY
. - The dump does not include "free space" in the disk files.
- The dump is text, not binary. For example a
BIGINT
takes 8 bytes in the file, but if, say, the value is "1" it takes 2 bytes in the dump: "...,1,..." (the number plus one of the commas). - On the other hand, some numbers, strings, dates, etc, will take more space in the dump.
- An empty table takes a minimum of something like 24KB on disk, but only a few hundred bytes (mostly for the
CREATE TABLE
) in the dump. - The dump is a text file; look at some of it (via more or less or something like that).
So, your 3:1 shrinkage is quite feasible. And a 2:1 expansion is possible.