valentine94
5/13/2015 - 3:07 PM

Query to list the size of every table in the database, largest first

Query to list the size of every table in the database, largest first

SELECT table_name AS "Tables", 
round(((data_length + index_length) / 1024 / 1024), 2) "Size in MB" 
FROM information_schema.TABLES 
WHERE table_schema = "DB_NAME"
ORDER BY (data_length + index_length) DESC;