SELECT table_schema AS `Database`, ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS `Size (MB)` FROM information_schema.tables GROUP BY table_schema ORDER BY `Size (MB)` DESC;
查看表大小排行
1 2 3 4 5 6 7 8 9 10
SELECT table_name AS `Table`, ROUND(((data_length + index_length) / 1024 / 1024), 2) AS `Size (MB)` FROM information_schema.tables WHERE table_schema = 'psi' ORDER BY `Size (MB)` DESC;