Re: Unused indexes

From: Martín Marqués <martin(dot)marques(at)gmail(dot)com>
To: ronljohnsonjr(at)gmail(dot)com
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Unused indexes
Date: 2018-12-01 12:51:13
Message-ID: CABeG9Lv0X2k83j9EXpW6cW4RQzyRvs6iFyoTLJ6D7DfDkGDqeg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

El sáb., 1 dic. 2018 a las 8:24, Ron (<ronljohnsonjr(at)gmail(dot)com>) escribió:
>
> For indexes that existed before the cluster was last started, and for which
> REINDEX hasn't been run on them since the cluster was last started... is it
> valid to say that an index has not been used since the cluster was started
> if these three pg_stat_all_indexes fields all have a value of 0?
>
> idx_scan

Just this one, and that the index doesn't force a constraint (it's not
a unique index).

One other thing to keep in mind is that, if you have hot_standby
replicas, the index might be used there, and the primary doesn't have
information of index_scans on other nodes of the cluster.

Regards,

--
Martín Marqués
It’s not that I have something to hide,
it’s that I have nothing I want you to see

In response to

Browse pgsql-general by date

  From Date Subject
Next Message PegoraroF10 2018-12-01 13:07:17 Re: Transition Tables doesn´t have OID
Previous Message Rene Romero Benavides 2018-12-01 12:42:02 Re: Unused indexes