Re: Statistics on index usage

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: François Battail <francois(dot)battail(at)sipibox(dot)fr>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Statistics on index usage
Date: 2016-11-01 14:51:12
Message-ID: CAOR=d=3iVO9a=1EH_5mLbENJsadgygpTZyYfvA_QNZ7RR5TzAw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Nov 1, 2016 at 8:43 AM, François Battail
<francois(dot)battail(at)sipibox(dot)fr> wrote:
> Dear List,
>
> does pgsql maintains statistics on index usage? I mean just a counter
> for each index in the database, incremented each time time it is used.
> It would be useful to help cleaning almost unused index and to avoid
> poisoning the global cache.
>
> I've found nothing so far but may be I've been missing something.

Yup it does keep track of index usage. To see all the various stuff
postgres keeps track of etc, try typing

select * from pg_ then hit tab. The two common ones I look at are:

pg_statio_all_indexes
pg_stat_user_indexes

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Melvin Davidson 2016-11-01 14:52:18 Re: Statistics on index usage
Previous Message François Battail 2016-11-01 14:43:41 Statistics on index usage