Re: timestamp for query in pg_stat_statements - Mailing list pgsql-hackers

From Julien Rouhaud
Subject Re: timestamp for query in pg_stat_statements
Date
Msg-id 20220306041709.7vsuheybkenysu7x@jrouhaud
Whole thread Raw
In response to timestamp for query in pg_stat_statements  (Zhihong Yu <zyu@yugabyte.com>)
Responses Re: timestamp for query in pg_stat_statements
List pgsql-hackers
On Sat, Mar 05, 2022 at 06:10:44PM -0800, Zhihong Yu wrote:
>
> Looking at pg_stat_statements, there doesn't seem to be timestamp column
> for when the underlying query is performed.
> Since the same query can be run multiple times, the absence of timestamp
> column makes finding the most recent invocation of the query difficult.
>
> Does it make sense to add such a column ?

I don't think it would be that helpful.  Why do you need to only know when the
last execution was, but no other details among every other cumulated counters?

You should consider using some other tools on top of pg_stat_statements (and
possibly other extensions) that performs snapshot regularly and can show you
all the details at the given frequency.



pgsql-hackers by date:

Previous
From: Zhihong Yu
Date:
Subject: timestamp for query in pg_stat_statements
Next
From: Bharath Rupireddy
Date:
Subject: Re: Allow async standbys wait for sync replication