Created
December 8, 2018 23:31
-
-
Save Mexidense/218c2ea59a9d0af00b5d74729702422e to your computer and use it in GitHub Desktop.
How to know table sizes on mysql for one DB
This file contains hidden or 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 + INDEX_LENGTH) / 1024 / 1024) AS `Size (MB)` | |
FROM | |
information_schema.TABLES | |
WHERE | |
TABLE_SCHEMA = "<NAME_DB>" | |
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