mysql数据库查询库中所有表所占空间大小

SELECT
CONCAT(table_schema,'.',table_name) AS 'TABLE_NAME',
CONCAT(ROUND(table_rows / 1000000, 4),'M') AS 'ROW_SIZE',
CONCAT(ROUND(data_length / (1024 * 1024),2),'M') AS 'DATA_SIZE',
CONCAT(ROUND(index_length / (1024 * 1024),2),'M') AS 'INDEX_SIZE',
CONCAT(ROUND((data_length + index_length) / (1024 * 1024),2),'M') AS 'TOTAL_SIZE'
FROM
information_schema. TABLES
WHERE
table_schema = 'bootdo'
ORDER BY 3 desc;

 

posted @ 2018-07-14 16:14  开发者导航  阅读(481)  评论(0)    收藏  举报