分类: Mysql/postgreSQL
2011-09-09 20:33:24
作用:
统计mysql数据库中所用innodb引擎表总的大小,数据总大小,索引总大小。
SELECT 'Total InnoDB Size' AS title, \
ROUND(SUM((data_length+index_length)/1024/1024)) AS total_mb, \
ROUND(SUM(data_length/1024/1024)) AS data_mb, \
ROUND(SUM(index_length/1024/1024)) AS index_mb \
FROM INFORMATION_SCHEMA.TABLES WHERE \
engine='InnoDB';