Last active
April 24, 2017 16:42
-
-
Save bradfordpythian/67a7ffd43cd873326f4a2b5f16045153 to your computer and use it in GitHub Desktop.
List summary table type and size details.
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 @@hostname, DATABASE() as table_schema, CURDATE() AS today; | |
SELECT if(length(table_name)>30,concat(left(table_name,28),'..'),table_name) AS table_name, | |
engine,row_format as format, table_rows, avg_row_length as avg_row, | |
round((data_length+index_length)/1024/1024,2) as total_mb, | |
round((data_length)/1024/1024,2) as data_mb, | |
round((index_length)/1024/1024,2) as index_mb | |
FROM information_schema.tables | |
WHERE table_schema=DATABASE() | |
ORDER BY 6 DESC | |
LIMIT 15; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment