把test换成你自己使用的数据库名称即可
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_schema = 'test'
group by table_name
order by data_length desc;
本文提供了一个SQL查询示例,用于获取指定数据库中各表的数据大小和索引大小,并按数据大小降序排列。
174万+

被折叠的 条评论
为什么被折叠?



