Last active
September 30, 2016 16:51
-
-
Save taeram/98b6ea19d779aa1f896309e4e8d39e56 to your computer and use it in GitHub Desktop.
MySQL Snippets
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
-- Table sizes, ordered by Database | |
SELECT table_schema AS "Database", | |
table_name AS "Table", | |
ROUND(((data_length) / 1024 / 1024), 2) AS "Data (MB)", | |
ROUND(((index_length) / 1024 / 1024), 2) AS "Indexes (MB)", | |
ROUND(((data_length + index_length) / 1024 / 1024), 2) "Total (MB)" | |
FROM information_schema.TABLES | |
WHERE table_schema NOT IN ("information_schema", "mysql") | |
ORDER BY table_schema ASC, table_name ASC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment