Skip to content

Instantly share code, notes, and snippets.

@kraken-chris
Created June 22, 2023 14:38
Show Gist options
  • Save kraken-chris/41cf84e3658eaa2e91dacf580a77684f to your computer and use it in GitHub Desktop.
Save kraken-chris/41cf84e3658eaa2e91dacf580a77684f to your computer and use it in GitHub Desktop.
Get the size of a specific DB table.
SELECT
table_name AS `Table`,
round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB`
FROM information_schema.TABLES
WHERE table_schema = "<db_name>"
AND table_name = "<table_name>";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment