Created
January 23, 2017 09:02
-
-
Save ytkhs/61b1c178648cf149f0fe521e3522a910 to your computer and use it in GitHub Desktop.
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, | |
engine, | |
table_rows, | |
avg_row_length, | |
floor((data_length+index_length)/1024/1024) AS MB | |
from | |
information_schema.tables | |
where | |
table_schema = 'DATABASE_NAME' | |
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