Re: Proposal: Track last-used timestamp for index usage

From: Sami Imseih <samimseih(at)gmail(dot)com>
To: Raghav Mittal <mittalr086(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Proposal: Track last-used timestamp for index usage
Date: 2026-04-01 02:58:03
Message-ID: CAA5RZ0vZ2d57-4SMd_fVyvCp05XL6eY+aWNEB2KVuAzbGp1_Hg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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)

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Sami Imseih 2026-04-01 02:53:48 Re: Refactor query normalization into core query jumbling