Created
July 15, 2022 11:26
-
-
Save ManiruzzamanAkash/6eb5694b9dd883602fc019b76f09f83a to your computer and use it in GitHub Desktop.
Get a database full tables and their size in MB
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
-- Database:cart_pulse | |
SELECT | |
TABLE_NAME AS `Table`, | |
ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024) AS `Size (MB)` | |
FROM | |
information_schema.TABLES | |
WHERE | |
TABLE_SCHEMA = 'cart_pulse' | |
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