Last active
June 5, 2018 07:48
-
-
Save nevadajames/460bc034d4e38042c0dc83a841370468 to your computer and use it in GitHub Desktop.
SQL script for getting table size in gigabytes ordered by largest
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,(data_length+index_length)/power(1024,3) tablesize_gb | |
| FROM information_schema.tables | |
| WHERE table_schema='database_name' | |
| ORDER BY (data_length+index_length)/power(1024,3) DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment