Table size appears to be larger, but when I download the database, the table size appears to be smaller, what is the reason behind this?

Viewed 75

When I check in the database, the table size appears to be larger, but when I download the database, the table size appears to be smaller, what is the reason behind this?

For example, It shows 2688672KB OR 2.6GB on the MySQL server, but when I download the file, it shows 1.24 GB. Why is there so much variation?

1. Query from database

enter image description here

2. File size check from local disk

enter image description here

(from Comment)

SHOW TABLE STATUS FROM defaultdb LIKE 'dbt_roi'\G 
*************************** 1. row *************************** 
Name: dbt_roi 
Engine: InnoDB 
Version: 10 
Row_format: Dynamic 
Rows: 13595095 
Avg_row_length: 93 
Data_length: 1269825536 
Max_data_length: 0 
Index_length: 1483374592 
Data_free: 7340032 
Auto_increment: 13650025 
Create_time: 2021-06-07 08:58:14 
Update_time: 2021-10-26 00:18:24 
Check_time: NULL Collation: latin1_swedish_ci 
Checksum: NULL 
1 Answers
Data_length:  1269825536 (1.18GiB)
Index_length: 1483374592 
Data_free:       7340032

Total:        2760540160 (2.57GiB)

Does this help to illustrate it?

The physical size of the file includes both data and indexes (and unused space, but this is usually small).

When you dump a table, the content of indexes don't need to be included. If you re-import the dump, indexes will be rebuilt from the data. All the dump needs is the definitions of which columns comprise each index.

Related