Execution history of a single query

Started by arun chirappurathalmost 2 years ago3 messagesgeneral
Jump to latest
#1arun chirappurath
arunsnmimt@gmail.com

Hi All,

From pg_stat_statements we can get the overall execution details of queries.

Can we get the execution details of a single queryid ?

Like today it took 6 seconds,yesterday 5 and so on..just for one query.

Thanks,
Arun

#2Greg Sabino Mullane
greg@turnstep.com
In reply to: arun chirappurath (#1)
Re: Execution history of a single query

Not directly through pg_stat_statements, no. But you can:

* Use log_min_duration_statement to spy on individual runs
* Periodically copy pg_stat_statements to another table, reset the stats,
and then you have some time-based buckets to play with.

Cheers,
Greg

#3Julien Rouhaud
rjuju123@gmail.com
In reply to: arun chirappurath (#1)
Re: Execution history of a single query

On Sat, 18 May 2024, 00:42 arun chirappurath, <arunsnmimt@gmail.com> wrote:

Hi All,

From pg_stat_statements we can get the overall execution details of
queries.

Can we get the execution details of a single queryid ?

Like today it took 6 seconds,yesterday 5 and so on..just for one query.

you can use PoWA for that: https://powa.readthedocs.io/en/latest/

Show quoted text