Table size 好像变大了,但是下载数据库的时候, table size 好像变小了,这是什么原因?

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?

当我查入数据库时​​,table的大小似乎变大了,但是当我下载数据库时,table的大小却变小了,这是什么原因?

例如,它在 MySQL 服务器上显示 2688672KB OR 2.6GB,但是当我下载文件时,它显示 1.24GB。为什么会有这么大的差异?

1.从数据库查询



2。从本地磁盘检查文件大小

(来自评论)

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 
Data_length:  1269825536 (1.18GiB)
Index_length: 1483374592 
Data_free:       7340032

Total:        2760540160 (2.57GiB)

这有助于说明吗?

文件的物理大小包括数据和索引(以及未使用的space,但这通常很小)。

转储table时,不需要包含索引的内容。如果您重新导入转储,索引将从数据重建。所有转储需要的是定义哪些列包含每个索引。