pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim Buttafuoco <jim@contactbda.com>
To: George Pavlov <gpavlov@mynewplace.com>
To: pgsql-sql@postgresql.org
Subject: Re: finding unused indexes?
Date: Tue, 1 Aug 2006 12:10:01 -0400
Message-ID: <20060801160934.M4017@contactbda.com> (raw)
In-Reply-To: <8C5B026B51B6854CBE88121DBF097A863329E8@ehost010-33.exch010.intermedia.net>
References: <44CE9C63.7010409@debraneys.com>
	<8C5B026B51B6854CBE88121DBF097A863329E8@ehost010-33.exch010.intermedia.net>

check out pg_stat_user_indexes, you will need to turn on the stats collection in your postgresql.conf file first.

Jim


---------- Original Message -----------
From: "George Pavlov" <gpavlov@mynewplace.com>
To: <pgsql-sql@postgresql.org>
Sent: Tue, 1 Aug 2006 09:05:34 -0700
Subject: [SQL] finding unused indexes?

> Anybody have a clever way to quickly find whether there are any unused
> indexes in a PG DB? One way I have done is to take queries from the DB
> log, prepend an explain to each and grep the results, but I am wondering
> if there are either any index  usage stats maintained somewhere inside
> Postgres or if there is a slicker/less cumbersome way of doing it. Also
> indexes used by functions are hard to simulate that way.
> 
> George
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
------- End of Original Message -------




view thread (6+ messages)  latest in thread

Message-ID: <20060801160934.M4017@contactbda.com>
Permalink:  ../20060801160934.M4017@contactbda.com/
Also on:    postgresql.org/message-id/20060801160934.M4017@contactbda.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: jim@contactbda.com, gpavlov@mynewplace.com
  Subject: Re: finding unused indexes?
  In-Reply-To: <20060801160934.M4017@contactbda.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox