Re: Re[2]: [PATCH] Add last_executed timestamp to pg_stat_statements

From: Christoph Berg <myon(at)debian(dot)org>
To: Sami Imseih <samimseih(at)gmail(dot)com>
Cc: Pavlo Golub <pavlo(dot)golub(at)cybertec(dot)at>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Re[2]: [PATCH] Add last_executed timestamp to pg_stat_statements
Date: 2026-02-03 16:27:24
Message-ID: aYIh7I9khvoewwH_@msg.df7cb.de
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Re: Sami Imseih
> I wonder if we can use GetCurrentStatementStartTimestamp()
> instead?

The main use case for this column is being able to retrieve the stats
that were updated since the last time one was looking. That only works
if it's the statement end time, or else long-running statements
spanning more than one poll interval would be missed.

Perhaps the column should rather be called "stats_last_updated" to
match "stats_since", and be moved to the very end? Similarly, nested
statements would also have to get that stamp.

Oh and, yes, I'm definitely +1 on this feature.

Christoph

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2026-02-03 16:33:20 Re: AIX support
Previous Message Andres Freund 2026-02-03 16:26:56 Odd code around ginScanToDelete