查询数据库中表的数据, 索引和留存空间的大小的语句:
SELECT * from
(
SELECT CONCAT(table_schema,'.',table_name) AS 'table_name',
table_rows AS 'Number of Rows',
ROUND(data_length/(1024*1024),6) AS 'data_size',
ROUND(index_length/(1024*1024),6) AS 'index_size' ,
ROUND(data_free/(1024*1024),6) AS'data_free',
ENGINE as 'engine'
FROM information_schema.TABLES
WHERE table_schema = 'bigdata-web'
) t ORDER BY data_free DESC;
网友评论