我试图找出数据库表的大小。 我运行'show table status'查询,我在结果中有data_length参数。 这是否代表数据库表的实际大小?
I am trying to find out the size of a database table. I ran the 'show table status' query, and i have the data_length parameter in the result. Does this represent the actual size of the database table?
最满意答案
对于InnoDB, data_length是表大小的估计值 ,以字节为单位,不计算二级索引。 文档说这是“数据文件的大小”,但该语言假设您将数据放在一个单独的文件中,而InnoDB并不总是如此。
对于InnoDB,表的大小有点模糊,因为InnoDB还在回滚段中全局存储行的一些副本,并且还存在磁盘存储的其他用途(数据字典,更改缓冲区)。
您还应该添加index_length ,它是二级索引的大小。
For InnoDB, the data_length is an estimate of the table size, in bytes, not counting secondary indexes. The documentation says this is the "size of the data file" but that language assumes you have data in a separate file, which isn't always the case with InnoDB.
The size of a table is a bit fuzzy for InnoDB, because InnoDB also stores some copies of rows globally in the rollback segment, and there are other uses of on-disk storage (data dictionary, change buffer).
You should also add index_length, which is the size of secondary indexes.
更多推荐
发布评论