一条查询可以搞定:
select table_schema,
sum(data_length+index_length)/1024/1024 as total_mb,
sum(data_length)/1024/1024 as data_mb,
sum(index_length)/1024/1024 as index_mb,
count(*) as tables
from information_schema.tables
group by table_schema
order by 2 desc;
另:合适增加使用index可以提高查询效率,但不可滥用。
Subscribe in reader

