Created
December 30, 2010 21:59
-
-
Save didip/760368 to your computer and use it in GitHub Desktop.
Find out size of tables and other meta information from MySQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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