mysql查看当前所有的数据库和索引大小

SELECT
    table_schema,
    concat(
        TRUNCATE (
            sum(data_length) / 1024 / 1024,
            2
        ),
        ' mb'
    ) AS data_size,
    concat(
        TRUNCATE (
            sum(index_length) / 1024 / 1024,
            2
        ),
        'mb'
    ) AS index_size
FROM
    information_schema. TABLES
#where table_schema = 'youdb' GROUP BY table_schema ORDER BY data_length DESC;

 

上一篇:hive 外部表操作注意事项


下一篇:drop、truncate、delete的区别