MySQL查看表占用文件大小脚本

it2026-02-27  3

脚本如下:

SELECT table_name AS TableName, TRUNCATE ( data_length / 1024 / 1024 / 1024, 2 ) AS DataLength, TRUNCATE ( index_length / 1024 / 1024 / 1024, 2 ) AS DataIndex, TRUNCATE (( data_length + index_length )/ 1024 / 1024 / 1024, 2 ) AS DataSum FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'coolcloud' ORDER BY DataSum DESC;

 

最新回复(0)