You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some cases, such as handling "Describe" messages, cleaning up
temporary relations at exit, or managing client read interrupts,
backends can remain in an "idle" state but still set xact_start
in pg_stat_activity. This results in misleading entries where
"idle" backends appear to have non-NULL transaction times.
Additionally, during temp relation cleanup or interrupt handling,
xact_start might incorrectly reflect the timestamp of
the last executed query, further confusing users.
This commit addresses the issue by ensuring pg_stat_activity
does not show transaction and query start times for "idle" backends,
setting them to NULL instead. This prevents confusing entries
for "idle" backends.
While it would be possible to correctly track backend states and
set timestamps, this approach would introduce performance overhead
due to frequent updates of state and timestamp. Moreover, it is not
particularly beneficial to treat processes like "Describe" message handling,
temp relation cleanup, or client read interrupts as regular transactions.
Therefore, the simpler and more efficient solution was adopted.
Discussion: https://postgr.es/m/20140424101827.2714.39486@wrigleys.postgresql.org
0 commit comments