美文网首页
查询数据库使用量

查询数据库使用量

作者: 勤劳的杯子 | 来源:发表于2023-11-22 13:38 被阅读0次
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 != 'mysql' and table_schema != 'sys' and table_schema != 'performance_schema' and  table_schema != 'information_schema'
order by table_rows desc, index_length desc;

相关文章

网友评论

      本文标题:查询数据库使用量

      本文链接:https://www.haomeiwen.com/subject/dlziwdtx.html