Skip to content

Instantly share code, notes, and snippets.

@KrustyHack
Last active July 2, 2021 12:55
Show Gist options
  • Save KrustyHack/ead986762b2e7652e79cfbd48f2eb048 to your computer and use it in GitHub Desktop.
Save KrustyHack/ead986762b2e7652e79cfbd48f2eb048 to your computer and use it in GitHub Desktop.
Cloud SQL MySQL - 5 biggest databases
SELECT TABLE_SCHEMA AS `Database`, TABLE_NAME AS `Table`, ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024) AS `Size (MB)` FROM information_schema.TABLES ORDER BY (DATA_LENGTH + INDEX_LENGTH) DESC LIMIT 5;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment