Думаю, так будет красивее:use information_schema;
SELECT
concat(table_schema,'.',table_name) AS sql_table,
concat(round(table_rows/1000000,2),'M') rows,
concat(round(data_length/(1024*1024*1024),2),'G') DATA,
concat(round(index_length/(1024*1024*1024),2),'G') idx,
concat(round((data_length+index_length)/(1024*1024*1024),2),'G') total_size,
round(index_length/data_length,2) idxfrac
FROM TABLES
ORDER BY data_length+index_length DESC
LIMIT 10;
+------------------------+--------+--------+--------+------------+---------+
| sql_table | rows | DATA | idx | total_size | idxfrac |
+------------------------+--------+--------+--------+------------+---------+
| dev.event_logs_backup2 | 75.83M | 14.39G | 13.31G | 27.70G | 0.93 |
| dev.event_logs_backup | 26.90M | 4.48G | 4.31G | 8.79G | 0.96 |
| dev.event_logs | 1.20M | 0.20G | 0.14G | 0.34G | 0.69 |
| mysql.help_topic | 0.00M | 0.00G | 0.00G | 0.00G | 0.05 |
| mysql.help_keyword | 0.00M | 0.00G | 0.00G | 0.00G | 0.18 |
| mysql.proc | 0.00M | 0.00G | 0.00G | 0.00G | 0.04 |
| mysql.help_category | 0.00M | 0.00G | 0.00G | 0.00G | 0.15 |
| mysql.help_relation | 0.00M | 0.00G | 0.00G | 0.00G | 2.11 |
+------------------------+--------+--------+--------+------------+---------+
10 rows in set (1.23 sec)