Created
September 15, 2012 21:32
-
-
Save mauricio/3729884 to your computer and use it in GitHub Desktop.
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 | |
| nspname,relname,relkind, | |
| round(100 * pg_relation_size(indexrelid) / pg_relation_size(indrelid)) / 100 | |
| AS index_ratio, | |
| pg_size_pretty(pg_relation_size(indexrelid)) AS index_size, | |
| pg_size_pretty(pg_relation_size(indrelid)) AS table_size | |
| FROM pg_index I | |
| LEFT JOIN pg_class C ON (C.oid = I.indexrelid) | |
| LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace) | |
| WHERE | |
| relname IN ('accounts_pkey') AND | |
| pg_relation_size(indrelid) > 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment