Created
August 3, 2021 09:23
-
-
Save froemken/921968eca6ae5eeb4410e9afcca1cfd5 to your computer and use it in GitHub Desktop.
SQL Query to get size in MB for data and index of given database name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT table_name AS "Table", ROUND((data_length / 1024 / 1024), 2) AS "Data size (MB)", ROUND((index_length / 1024 / 1024), 2) AS "Index size (MB)" | |
FROM information_schema.TABLES | |
WHERE table_schema = "[database_name]" | |
ORDER BY data_length DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment