时间:2021-07-01 10:21:17 帮助过:21人阅读
一、统计类
1.查询整个数据库下表内存
SELECT TABLE_NAME,ROUND(table_rows/10000,2) AS ‘数据总量(万条)‘,
ROUND( (INDEX_LENGTH + DATA_LENGTH) / 1024 / 1024, 2 ) AS ‘总内存(MB)‘,
ROUND(DATA_LENGTH / 1024 / 1024, 2) AS ‘数据内存(MB)‘,
ROUND(INDEX_LENGTH / 1024 / 1024, 2) AS ‘索引内存(MB)‘
FROM INFORMATION_SCHEMA. TABLES
WHERE TABLE_SCHEMA =‘数据库名称‘
ORDER BY DATA_LENGTH desc
Mysql常用语句汇总
标签:内存 查询 for sch esc 个数 nbsp 名称 where