Can someone set me straight on whether the following statements are true in postgresql-8.1.x and if they aren't true, what queries might I need to run to find these answers?

Also would be interested to know if these changed in a certain version of postgresql.

The following query shows all indexes which are not used.

select schemaname,relname,indexrelname,idx_tup_read,idx_tup_fetch from pg_stat_user_indexes where idx_tup_read = 0;


The following query shows all indexes which have differing values between idx_tup_read and idx_tup_fetch indicating indexes which likely need rebuilt via REINDEX:

select schemaname,relname,indexrelname,idx_tup_read,idx_tup_fetch from pg_stat_user_indexes where idx_tup_read != idx_tup_fetch;


--
Jeff Frost, Owner       <[EMAIL PROTECTED]>
Frost Consulting, LLC   http://www.frostconsultingllc.com/
Phone: 650-780-7908     FAX: 650-649-1954

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
      choose an index scan if your joining column's datatypes do not
      match

Reply via email to