欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

mysql 查看数据库索引 和 数据 大小 博客分类: mysql mysql索引大小数据大小 

程序员文章站 2024-03-22 20:21:58
...

查看数据概况

 select * from information_schema.TABLES 
  where information_schema.TABLES.TABLE_SCHEMA='business_shop2'
  and information_schema.TABLES.TABLE_NAME='ls_prod'
 


  请尊重知识,请尊重原创 更多资料参考请见  http://www.cezuwang.com/listFilm?page=1&areaId=906&filmTypeId=1
查看索引大小

 select CONCAT(ROUND(SUM(t.index_length)/(1024*1024), 2), ' MB') AS 'Total Index Size' from (
 select index_length from information_schema.TABLES 
  where information_schema.TABLES.TABLE_SCHEMA='business_shop2'
  and information_schema.TABLES.TABLE_NAME='ls_prod' ) as t 



查看数据大小

   select CONCAT(ROUND(SUM(t.data_length)/(1024*1024), 2), ' MB') AS 'Total data Size' from (
 select data_length from information_schema.TABLES 
  where information_schema.TABLES.TABLE_SCHEMA='business_shop2'
  and information_schema.TABLES.TABLE_NAME='ls_prod' ) as t 

   请尊重知识,请尊重原创 更多资料参考请见  http://www.cezuwang.com/listFilm?page=1&areaId=906&filmTypeId=1