Re: timestamp for query in pg_stat_statements

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: Zhihong Yu <zyu(at)yugabyte(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: timestamp for query in pg_stat_statements
Date: 2022-03-06 04:17:09
Message-ID: 20220306041709.7vsuheybkenysu7x@jrouhaud
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2022-03-06 06:57:52 Re: Allow async standbys wait for sync replication
Previous Message Zhihong Yu 2022-03-06 02:10:44 timestamp for query in pg_stat_statements