franc3000
10/30/2017 - 11:32 PM

table_size.sql

SELECT 
     table_schema, 
     table_name, 
     round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB`,
     sum(table_rows) Rows
FROM information_schema.TABLES 
WHERE table_schema='paretodb'
GROUP BY 1,2
ORDER BY (data_length + index_length) DESC
LIMIT 30
;