Skip to content

Instantly share code, notes, and snippets.

@ravelll
Last active December 5, 2017 01:17
Show Gist options
  • Select an option

  • Save ravelll/a2e151288305e551c738 to your computer and use it in GitHub Desktop.

Select an option

Save ravelll/a2e151288305e551c738 to your computer and use it in GitHub Desktop.
SELECT table_name, table_rows AS tbl_rows, avg_row_length AS rlen,
floor((data_length+index_length)/1024/1024) AS allMB,
floor((data_length)/1024/1024) AS dMB,
floor((index_length)/1024/1024) AS iMB
FROM information_schema.tables
WHERE table_schema=database()
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