mysql查询数据库中每一张表的内存大小

时间:2022-02-10 21:06:55
SELECT TABLE_NAME,DATA_LENGTH+INDEX_LENGTH,TABLE_ROWS,concat(round((DATA_LENGTH+INDEX_LENGTH)/1024/1024,2), 'MB') as data FROM information_schema.tables WHERE TABLE_SCHEMA='test' ORDER BY DATA_LENGTH+INDEX_LENGTH desc;

结果展示:

mysql查询数据库中每一张表的内存大小