Re: Re[2]: [PATCH] Add last_executed timestamp to pg_stat_statements - Mailing list pgsql-hackers

From Christoph Berg
Subject Re: Re[2]: [PATCH] Add last_executed timestamp to pg_stat_statements
Date
Msg-id aYIh7I9khvoewwH_@msg.df7cb.de
Whole thread Raw
In response to Re: Re[2]: [PATCH] Add last_executed timestamp to pg_stat_statements  (Sami Imseih <samimseih@gmail.com>)
Responses Re: Re[2]: [PATCH] Add last_executed timestamp to pg_stat_statements
List 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



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Odd code around ginScanToDelete
Next
From: Tom Lane
Date:
Subject: Re: AIX support