xiao987334176

一、概述

最近上线了一个项目,运行了一个月。想知道mysql库中,哪个表最大,有多少行数据。

由于库里面有上百张表,一个个查看比较费劲。

 

二、查询表大小

我需要查询的库名为:kite

因此sql语句为:

select
table_schema as \'数据库\',
table_name as \'表名\',
table_rows as \'记录数\',
truncate(data_length/1024/1024, 2) as \'数据容量(MB)\',
truncate(index_length/1024/1024, 2) as \'索引容量(MB)\'
from information_schema.tables
where table_schema=\'kite\'
order by table_rows desc, index_length desc;

结果如下:

 

 

本文参考链接:

https://www.cnblogs.com/--smile/p/11451238.html

 

分类:

技术点:

相关文章:

  • 2021-11-29
  • 2021-08-24
  • 2021-11-29
  • 2021-08-14
  • 2021-11-16
  • 2021-08-24
  • 2021-12-09
猜你喜欢
  • 2021-11-26
  • 2021-11-29
  • 2021-12-09
  • 2021-12-09
  • 2021-08-24
  • 2021-11-29
相关资源
相似解决方案