MySQL Information_schema index_length [英] MySQL Information_schema index_length

查看:84
本文介绍了MySQL Information_schema index_length的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我检查了有关我的mysql数据库的信息,发现仅在primary_key列上具有索引的表的index_length为0.其他具有外键和索引的表的index_length具有值.为什么会这样?

I checked information about my mysql database, and found, that index_length on tables, that have index only on primary_key column is 0. Index_length of other tables, that have foreign keys and indexes on them has value. Why is it so?

更新:感谢您的帮助,这里也给出了很好的答案:

UPDATE: Thanks for help, also nice answer given here: How to find out size of indexes in mysql (including primary keys)

推荐答案

表类型为InnoDB.InnoDB将数据存储在主键(索引组织表)中.因此,主键已经在DATA_LENGTH中进行了计算.INDEX_LENGTH表示所有二级索引的大小".

The table type is InnoDB. InnoDB stores the data in the primary key (index-organized table). So the primary key is already accounted in the DATA_LENGTH. INDEX_LENGTH means "the size of all secondary indexes".

这篇关于MySQL Information_schema index_length的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆