Skip to content

Instantly share code, notes, and snippets.

@daniDLL
Created December 18, 2020 11:17
Show Gist options
  • Save daniDLL/839be07885b30817a9a8315308f886fe to your computer and use it in GitHub Desktop.
Save daniDLL/839be07885b30817a9a8315308f886fe to your computer and use it in GitHub Desktop.
get-schema-table-size
SELECT TABLE_NAME AS `Table`, ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024) AS `Size (MB)` FROM information_schema.TABLES WHERE TABLE_SCHEMA = "<database-schema>" 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