Created
October 1, 2010 10:24
-
-
Save sriedel/606030 to your computer and use it in GitHub Desktop.
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
SELECT idx.relname as table, | |
idx.indexrelname as index, | |
pg_relation_size( idx.indexrelname::text ) as bytes, | |
cls.relpages as pages, | |
cls.reltuples as tuples, | |
idx.idx_scan as scanned, | |
idx.idx_tup_read as read, | |
idx.idx_tup_fetch as fetched | |
FROM pg_stat_user_indexes idx, | |
pg_class cls , | |
pg_index | |
WHERE cls.relname = idx.relname | |
AND idx.indexrelid = pg_index.indexrelid | |
AND pg_index.indisunique is not true | |
AND pg_index.indisprimary is not true | |
AND idx.indexrelname not ilike '%slony%' | |
AND idx.indexrelname not like 'sl\_%' | |
ORDER BY idx.relname, | |
idx.indexrelname; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment