public inbox for [email protected]  
help / color / mirror / Atom feed
From: Sami Imseih <[email protected]>
To: Raghav Mittal <[email protected]>
Cc: [email protected]
Subject: Re: Proposal: Track last-used timestamp for index usage
Date: Tue, 31 Mar 2026 21:58:03 -0500
Message-ID: <CAA5RZ0vZ2d57-4SMd_fVyvCp05XL6eY+aWNEB2KVuAzbGp1_Hg@mail.gmail.com> (raw)
In-Reply-To: <CA+dbf3gvWCeF8j_DBjtaPcNmm=E9d_Z7sPdaJRuanGfAw2Rvow@mail.gmail.com>
References: <CA+dbf3gvWCeF8j_DBjtaPcNmm=E9d_Z7sPdaJRuanGfAw2Rvow@mail.gmail.com>

Hi,

> I’ve been exploring index usage statistics in PostgreSQL and noticed that
> pg_stat_user_indexes only provides cumulative counters (idx_scan), but not
> recency information.

pg_stat_user_indexes.last_idx_scan and pg_stat_all_tableslast_seq_scan have been
around since v16. See [1]

Is that what you are looking for?

[1] [https://www.postgresql.org/docs/devel/monitoring-stats.html#MONITORING-PG-STAT-ALL-INDEXES-VIEW]

--
Sami Imseih
Amazon Web Services (AWS)





view thread (3+ messages)

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: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Proposal: Track last-used timestamp for index usage
  In-Reply-To: <CAA5RZ0vZ2d57-4SMd_fVyvCp05XL6eY+aWNEB2KVuAzbGp1_Hg@mail.gmail.com>

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

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