Skip to content

Instantly share code, notes, and snippets.

@tairov
Created June 19, 2017 15:58
Show Gist options
  • Save tairov/fe383fa3fe3920896408e6f4f4715254 to your computer and use it in GitHub Desktop.
Save tairov/fe383fa3fe3920896408e6f4f4715254 to your computer and use it in GitHub Desktop.
get table sizes in mysql schema
use mysql;
SELECT
table_name AS `Table`,
round(((data_length + index_length) / 1024 / 1024), 2) `size_MB`
FROM information_schema.TABLES
WHERE table_schema = "backend"
order by size_MB desc;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment