当前位置:   article > 正文

mysql 索引占用空间_mysql查看索引占用空间

mysql索引占用的空间0

mysql中查看索引占用的存储空间使用下面的sql语句:

select table_name,concat(truncate(data_length/1024/1024,2),'MB') as data_size,concat(truncate(index_length/1024/1024,2),'MB') as index_size

from information_schema.tables where table_name='bi_money_list'

order by index_size desc;

查看单个表的细分索引情况:

SELECT

sum(stat_value) pages,

table_name part,

index_name,

concat(round(sum(stat_value)/1000000,2),'M',' rows') * @@innodb_page_size size

FROM

mysql.innodb_index_stats

WHERE

table_name = 'bi_money_list'

AND database_name = 'bi_longzhu_cmge_s6'

AND stat_description LIKE 'Number of pages in the index'

GROUP BY

table_name, index_name;

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/码创造者/article/detail/832705
推荐阅读
相关标签
  

闽ICP备14008679号