Created
March 6, 2018 02:58
-
-
Save jfriv/e08a85bcbea82e6dce5caf486ab4569e to your computer and use it in GitHub Desktop.
MySQL select table data size and index size in GB for a database
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_schema, table_name, (data_length / 1024 / 1024 / 1024) as data_size_gb, (index_length / 1024 / 1024 / 1024) as index_size_gb | |
| FROM information_schema.TABLES | |
| WHERE table_schema='mydatabase' | |
| GROUP BY table_name | |
| ORDER BY index_length DESC LIMIT 10; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment