Skip to content

Instantly share code, notes, and snippets.

@chrisledet
Created January 21, 2017 04:03
Show Gist options
  • Save chrisledet/88bca9c73a569d082a982afea018072c to your computer and use it in GitHub Desktop.
Save chrisledet/88bca9c73a569d082a982afea018072c to your computer and use it in GitHub Desktop.
View indices usage in PostgreSQL
-- filter by table name
select indexrelname, idx_scan, idx_tup_read, idx_tup_fetch from pg_stat_user_indexes where relname = '<TABLE NAME>';
-- filter by index name
select idx_scan, idx_tup_read, idx_tup_fetch from pg_stat_user_indexes where indexrelname = '<IDX NAME>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment