Re: How to find out unused indexes?

From: Abdul Sayeed <abdulsayeed24(at)gmail(dot)com>
To: Raghavendra <raghavendra(dot)rao(at)enterprisedb(dot)com>
Cc: "ascot(dot)moss(at)gmail(dot)com" <ascot(dot)moss(at)gmail(dot)com>, pgsql-general general <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to find out unused indexes?
Date: 2013-09-03 09:31:19
Message-ID: CAHb=FFz-EvXA2GorymXHkELzHy-VFOa2ywi0EkXymd=9RbkkBw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Below query can be handy to find unused indexes.

select indexrelname from pg_stat_user_indexes where idx_scan = 0 and
idx_tup_read = 0 and idx_tup_fetch = 0 ;

Hope it helps.

Thanks & Regards,
Abdul Sayeed
EnterpriseDB Corporation - RDBA Team
The Postgres Database Company

Office: +1-732-931-7033/+91-20-305-89510
Fax: +91-20-30589502
Skype: abdul.sayeed24

Website: www.enterprisedb.com
EnterpriseDB Blog : http://blogs.enterprisedb.com
Follow us on Twitter : http://www.twitter.com/enterprisedb

This e-mail message (and any attachment) is intended for the use of the
individual or entity to whom it is addressed. This message contains
information from EnterpriseDB Corporation that may be privileged,
confidential, or exempt from disclosure under applicable law. If you are
not the intended recipient or authorized to receive this for the intended
recipient, any use, dissemination, distribution,retention, archiving, or
copying of this communication is strictly prohibited. If you have received
this e-mail in error, please notify the sender immediately by reply e-mail
and delete this message.

On Tue, Sep 3, 2013 at 12:14 PM, Raghavendra <
raghavendra(dot)rao(at)enterprisedb(dot)com> wrote:

> On Tue, Sep 3, 2013 at 11:36 AM, ascot(dot)moss(at)gmail(dot)com <
> ascot(dot)moss(at)gmail(dot)com> wrote:
>
>> Hi,
>>
>> Can you please advise how to find out all unused indexes in PG?
>>
>> regards
>>
>
> Below wiki link should help; under "Unused Index" section:
>
> http://wiki.postgresql.org/wiki/Index_Maintenance
>
> ---
> Regards,
> Raghavendra
> EnterpriseDB Corporation
> Blog: http://raghavt.blogspot.com/
>
>
>>
>> --
>> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-general
>>
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2013-09-03 13:31:28 Re: Dump/Reload pg_statistic to cut time from pg_upgrade?
Previous Message Raghavendra 2013-09-03 06:44:55 Re: How to find out unused indexes?