Created
September 21, 2016 20:16
-
-
Save jcook793/9f14ccc3afe8de8f9790a8ae4a9ceccb to your computer and use it in GitHub Desktop.
Get table sizes 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 table_schema as 'schema', | |
table_name as 'table', | |
round(((data_length + index_length) / 1024 / 1024 / 1024), 0) 'gigs', | |
round((data_length + index_length) / | |
(select sum(data_length + index_length) | |
from information_schema.tables) * 100, 0) 'percent' | |
from information_schema.tables | |
order by (data_length + index_length) desc; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment