Re: is pg_stat_activity "transactional"? How fast does it update?
В списке pgsql-general по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: is pg_stat_activity "transactional"? How fast does it update? |
| Дата | |
| Msg-id | 755975.1749565677@sss.pgh.pa.us обсуждение |
| Ответ на | is pg_stat_activity "transactional"? How fast does it update? (Dominique Devienne <ddevienne@gmail.com>) |
| Список | pgsql-general |
Dominique Devienne <ddevienne@gmail.com> writes:
> So when and how fast does pg_stat_activity update, in the face of a
> PQfinish?
The shared state underlying pg_stat_activity is updated
immediately when something changes. However ...
PQfinish is asynchronous: it sends a "goodbye" message and then
closes the connection without waiting for a response. So
depending on system load, the associated backend could still be
alive for some milliseconds. There might be other client
libraries that do that differently.
Another thing that might be biting you is that a backend inspecting
pg_stat_activity() takes a snapshot of the view's contents and then
holds onto that snapshot until end of transaction. You can get
around that with pg_stat_clear_snapshot().
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера