一、统计类
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