Mysql – Physical or logical backup takes more space when backing up same MySQL database

MySQL

Physical backup is copying the data files that belongs to database. Logical backup is using SQL statements.
So physical or logical backup takes more space when backing up same MySQL database?

Best Answer

If you backup the files by copying the directory tree, the backup is the same size as the original.

If you use mysqldump (or similar tool) to backup, that will contain CREATE and INSERT statements to recreate the database from scratch. This can be larger or smaller, depending on the data involved.

An example of "smaller": a BIGINT takes 8 bytes in a table, but if the value is 1, it will take about 2 bytes in a logical dump (1 and a comma).