Skip to content

Instantly share code, notes, and snippets.

@dnozay
Created April 23, 2013 19:22
Show Gist options
  • Save dnozay/5446579 to your computer and use it in GitHub Desktop.
Save dnozay/5446579 to your computer and use it in GitHub Desktop.
get mysql table sizes based on http://stackoverflow.com/questions/9620198
# get mysql table sizes
# based on http://stackoverflow.com/questions/9620198
SELECT
concat(table_schema, '.', table_name) AS "Table",
table_rows AS "number of rows",
round((data_length / 1024 / 1024), 2) "Data in MB",
round((index_length / 1024 / 1024), 2) "Indexes in MB"
FROM information_schema.TABLES;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment