Skip to content

Instantly share code, notes, and snippets.

@k0uki
Created January 22, 2020 09:24
Show Gist options
  • Save k0uki/1533b39c9198b9279484024e7688c14e to your computer and use it in GitHub Desktop.
Save k0uki/1533b39c9198b9279484024e7688c14e to your computer and use it in GitHub Desktop.
Check disk usage per table at MySQL
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