Re: Unused indexes - PostgreSQL 9.2 - Mailing list pgsql-general

From Lucas Possamai
Subject Re: Unused indexes - PostgreSQL 9.2
Date
Msg-id CAE_gQfXKWD8ao3mubJzdq1KcFnNCsPAGj+6+ocR1ZzPB4Udbxg@mail.gmail.com
Whole thread Raw
In response to Re: Unused indexes - PostgreSQL 9.2  (Melvin Davidson <melvin6925@gmail.com>)
Responses Re: Unused indexes - PostgreSQL 9.2
List pgsql-general

And what happens if you run this query?

SELECT idstat.schemaname AS schema,
       idstat.relname AS table_name,
       indexrelname AS index_name,
       idstat.idx_scan AS times_used,
       pg_size_pretty(pg_relation_size(quote_ident(idstat.schemaname) || '.' || quote_ident(idstat.relname))) AS table_size,
       pg_size_pretty(pg_relation_size(quote_ident(idstat.schemaname) || '.' || quote_ident(indexrelname))) AS index_size,
       n_tup_upd + n_tup_ins + n_tup_del as num_writes,
       indexdef AS definition
FROM pg_stat_user_indexes AS idstat
JOIN pg_indexes ON indexrelname = indexname
JOIN pg_stat_user_tables AS tabstat ON idstat.relname = tabstat.relname
WHERE indexrelname = ' {YOUR QUERY NAME } ';


Sorry.. not sure what I should put into the WHERE clause  ..

But, taking off the WHERE it returns me 600 rows

pgsql-general by date:

Previous
From: Melvin Davidson
Date:
Subject: Re: Unused indexes - PostgreSQL 9.2
Next
From: Melvin Davidson
Date:
Subject: Re: Unused indexes - PostgreSQL 9.2