美文网首页
OPTIMIZE TABLE

OPTIMIZE TABLE

作者: 呆若木 | 来源:发表于2019-10-13 16:27 被阅读0次

命令官网地址

查询数据库中表的数据, 索引和留存空间的大小的语句:

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;

相关文章

网友评论

      本文标题:OPTIMIZE TABLE

      本文链接:https://www.haomeiwen.com/subject/qhfkmctx.html