当遭逢数据库占用空间非常大的境况下,能够用于下语句查找大数据量的表

SELECT 
    TABLE_NAME
    ,round((DATA_LENGTH/1024/1024),2)  'DATA_SIZE(M)'
    ,round((INDEX_LENGTH/1024/1024),2)  'INDEX_SIZE(M)'
    ,AVG_ROW_LENGTH
    ,MAX_DATA_LENGTH
    ,CREATE_TIME
FROM information_schema.tables
WHERE TABLE_SCHEMA ='库名'
ORDER BY 2 desc;

运作结果

4503.com 1

4503.com,