Skip to content

Instantly share code, notes, and snippets.

@aivis
Created July 18, 2020 09:33
Show Gist options
  • Select an option

  • Save aivis/b8fd504c3028ce042a7fe36499eb8173 to your computer and use it in GitHub Desktop.

Select an option

Save aivis/b8fd504c3028ce042a7fe36499eb8173 to your computer and use it in GitHub Desktop.
SELECT TABLE_SCHEMA, TABLE_NAME, ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024 / 1024, 2) AS `Size / GB`
FROM information_schema.TABLES
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