查询数据库表大小

2021-08-18  本文已影响0人  诗琪Michael

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

上一篇 下一篇

猜你喜欢

热点阅读