Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 002289F95A8 for ; Wed, 10 Oct 2007 10:36:28 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 25478-09 for ; Wed, 10 Oct 2007 10:36:25 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 8B4509F9599 for ; Wed, 10 Oct 2007 10:36:25 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l9ADZxis015004; Wed, 10 Oct 2007 09:35:59 -0400 (EDT) To: "George Pavlov" cc: "Brad Nicholson" , pgsql-sql@postgresql.org, jim@contactbda.com Subject: Re: finding unused indexes? In-reply-to: <8C5B026B51B6854CBE88121DBF097A86013F6F6C@ehost010-33.exch010.intermedia.net> References: <8C5B026B51B6854CBE88121DBF097A863329E8@ehost010-33.exch010.intermedia.net> <1154448707.2624.11.camel@dba5.int.libertyrms.com> <8C5B026B51B6854CBE88121DBF097A86013F6F6C@ehost010-33.exch010.intermedia.net> Comments: In-reply-to "George Pavlov" message dated "Tue, 09 Oct 2007 11:58:49 -0700" Date: Wed, 10 Oct 2007 09:35:59 -0400 Message-ID: <15003.1192023359@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/47 X-Sequence-Number: 29419 "George Pavlov" writes: > so is it safe to say that an index that has > pg_stat_user_indexes.idx_scan, pg_stat_user_indexes.idx_tup_read, and > pg_stat_user_indexes.idx_tup_fetch all equal to 0 has not been used > (since stats have been reset)? > i have a bunch of those and all of them have > pg_statio_user_indexes.idx_blks_read > 0 and most of those have > pg_statio_user_indexes.idx_blks_hit > 0. when/why would that happen? You have stats_block_level turned on, but not stats_tuple_level? You have a lot of searches that find no rows? regards, tom lane