pg_stat_user_indexes view clarification

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 	<jeff@xxxxxxxxxxxxxxxxxxxxxx>
Frost Consulting, LLC 	http://www.frostconsultingllc.com/
Phone: 650-780-7908	FAX: 650-649-1954


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux