Обсуждение: Execution history of a single query

Поиск
Список
Период
Сортировка

Execution history of a single query

От
arun chirappurath
Дата:
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

Re: Execution history of a single query

От
Greg Sabino Mullane
Дата:
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

Re: Execution history of a single query

От
Julien Rouhaud
Дата:
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/