Created
January 22, 2020 09:24
-
-
Save k0uki/1533b39c9198b9279484024e7688c14e to your computer and use it in GitHub Desktop.
Check disk usage per table at 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_name, | |
floor((avg_row_length)/1024) as avg_row_kb, | |
floor((data_length)/1024/1024) as data_mb, | |
floor((index_length)/1024/1024) as index_mb | |
from tables | |
where table_schema = "schema_name" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment