Re: index stat

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <pgsql-performance(at)postgresql(dot)org>, "Lance Campbell" <lance(at)uiuc(dot)edu>
Subject: Re: index stat
Date: 2007-11-07 16:32:15
Message-ID: 4731942E.EE98.0025.0@wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

>>> On Mon, Nov 5, 2007 at 10:42 AM, in message
<B10E6810AC2A2F4EA7550D072CDE8760197DD5(at)SAB-FENWICK(dot)sab(dot)uiuc(dot)edu>, "Campbell,
Lance" <lance(at)uiuc(dot)edu> wrote:

> How can I [. . .] get rid of some unnecessary indexes

Here's what I periodically run to look for unused indexes:

select relname, indexrelname
from pg_stat_user_indexes
where indexrelname not like '%_pkey'
and idx_scan = 0
order by relname, indexrelname
;

We omit the primary keys from the list (based on our naming
convention) because they are needed to ensure integrity.

-Kevin

In response to

  • index stat at 2007-11-05 16:42:46 from Campbell, Lance

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2007-11-07 16:34:52 Re: Estimation problem with a LIKE clause containing a /
Previous Message Guillaume Smet 2007-11-07 13:38:04 Re: Estimation problem with a LIKE clause containing a /