Skip to content

Instantly share code, notes, and snippets.

@fredrikroos
Created August 21, 2013 15:16
Show Gist options
  • Save fredrikroos/6295802 to your computer and use it in GitHub Desktop.
Save fredrikroos/6295802 to your computer and use it in GitHub Desktop.
Busy indexes
SELECT c.relname AS ctablename, ipg.relname AS indexname, x.indnatts AS number_of_columns, idx_scan, idx_tup_read, idx_tup_fetch,indexrelname FROM pg_index x JOIN pg_class c ON c.oid = x.indrelid JOIN pg_class ipg ON ipg.oid = x.indexrelid JOIN pg_stat_all_indexes psai ON x.indexrelid = psai.indexrelid where c.relname = 'objektareas' order by idx_scan desc;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment