Skip to content

Instantly share code, notes, and snippets.

@aczietlow
Last active September 18, 2017 08:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aczietlow/6b8557e587ce3e75c2e7952c33a5e0bd to your computer and use it in GitHub Desktop.
Save aczietlow/6b8557e587ce3e75c2e7952c33a5e0bd to your computer and use it in GitHub Desktop.
SELECT concat( table_schema, '.', table_name ) table_name,
concat( round( data_length / ( 1024 *1024 ) , 2 ) , 'M' ) data_length,
concat( round( index_length / ( 1024 *1024 ) , 2 ) , 'M' ) index_length,
concat( round( round( data_length + index_length ) / ( 1024 *1024 ) , 2 ) , 'M' ) total_size
FROM information_schema.TABLES
ORDER BY LENGTH(total_size) DESC, total_size DESC
LIMIT 50;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment