'show table status'中的Data

编程入门 行业动态 更新时间:2024-10-24 16:31:01
'show table status'中的Data_length(Data_length in 'show table status')

我试图找出数据库表的大小。 我运行'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.

更多推荐

本文发布于:2023-08-07 13:03:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1464267.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:table   show   Data   status

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!