Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 75EC89FCB61 for ; Wed, 7 Nov 2007 12:32:45 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 59317-09-2 for ; Wed, 7 Nov 2007 12:32:42 -0400 (AST) Received: from gwmta.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by postgresql.org (Postfix) with ESMTP id F037C9FC81F for ; Wed, 7 Nov 2007 12:32:41 -0400 (AST) Received: from Courts-MTA by gwmta.wicourts.gov with Novell_GroupWise; Wed, 07 Nov 2007 10:32:40 -0600 Message-Id: <4731942E.EE98.0025.0@wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 7.0.2 Date: Wed, 07 Nov 2007 10:32:15 -0600 From: "Kevin Grittner" To: , "Lance Campbell" Subject: Re: index stat References: In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/81 X-Sequence-Number: 27496 >>> On Mon, Nov 5, 2007 at 10:42 AM, in message , = "Campbell, Lance" wrote:=20 > How can I [. . .] get rid of some unnecessary indexes =20 Here's what I periodically run to look for unused indexes: =20 select relname, indexrelname from pg_stat_user_indexes where indexrelname not like '%_pkey' and idx_scan =3D 0 order by relname, indexrelname ; =20 We omit the primary keys from the list (based on our naming convention) because they are needed to ensure integrity. =20 -Kevin =20