MySQL get table size

SELECT TABLE_NAME AS `Table`, ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024) AS `Size (MB)` FROM information_schema.TABLES WHERE TABLE_SCHEMA = "db" ORDER BY     (DATA_LENGTH + INDEX_LENGTH)
 DESC;

 

 

select table_name as 'tableName', round(data_length+index_length)/1024/1024 as sizeMB from information_schema.tables where table_schema='db' order by sizeMB;

 

 

posted @ 2022-06-15 11:00  FredGrit  阅读(50)  评论(0)    收藏  举报