Tables sorted by size in Megabytes

Submitted by:Jhon Smith

Date added:04 June, 2013


This is a very handy query that sorts your tables by their physical size in megabytes. Just be sure to edit the query to include the database name.

Tags: sort data , sort by megabytes

Code Snippet:

select table_name, engine, table_rows, data_length, round(((data_length+index_length)/1024/1024),0) "MB"  
from information_schema.tables where table_schema = 'MY_DATABASE' order by data_length;