| От | Tom Lane |
|---|---|
| Тема | Re: query execution time for last 24 hours in PostgreSQL |
| Дата | |
| Msg-id | 463820.1716492378@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: query execution time for last 24 hours in PostgreSQL (Holger Jakobs <holger@jakobs.com>) |
| Список | pgsql-admin |
Holger Jakobs <holger@jakobs.com> writes:
> Am 23.05.24 um 20:07 schrieb nikhil kumar:
>> Can you please let me know anyone how to get each query execution time
>> from last 24 hours in PostgreSQL
> pg_stat_activity shows current activity, not historic activity.
> Unless you use an extension like pg_stat_statements, or log your
> statements, the information won't be available.
pg_stat_statements only collects cumulative runtime. The OP seems
to be asking for the runtime of each execution of each statement.
The only way to get that is by logging the durations (see log_duration
and related settings) and then scraping the postmaster log. You
might want to use pgbadger or a similar tool to help with the scraping
and subsequent data analysis.
regards, tom lane
В списке pgsql-admin по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера