Skip to content

Instantly share code, notes, and snippets.

@didip
Created December 30, 2010 21:59
Show Gist options
  • Save didip/760368 to your computer and use it in GitHub Desktop.
Save didip/760368 to your computer and use it in GitHub Desktop.
Find out size of tables and other meta information from MySQL
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,
table_rows,
engine
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = 'coolshit_dev'
ORDER BY data_length DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment