Re: Doc: clarify possibility of ephemeral discrepancies between state and wait_event in pg_stat_activity

From: Sami Imseih <samimseih(at)gmail(dot)com>
To: Alex Friedman <alexf01(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Doc: clarify possibility of ephemeral discrepancies between state and wait_event in pg_stat_activity
Date: 2025-02-26 20:00:53
Message-ID: CAA5RZ0ssBs_x=nbrgOViw+E8gBcG0eLHraid1kH-Eg+rx5wm-w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I am not sure if the wait_event vs state relationship needs to
be documented specifically. I can think of another discrepancy
such as query_id = NULL and state = active, which occurs when
the query is still being parsed and jumbled and a query_id is not yet
available. There are probably other ephemeral discrepancies
across all these fields.

Another common pattern is joining pg_stat_activity and pg_locks,
and that will have the same problem. Of course, these are different
views being joined, so maybe there isn't an expectation of 100%
accuracy, but worth calling this out as well.

If we do need to document anything, which I am not convinced we should,
it should be more generic.

--

Sami Imseih
Amazon Web Services (AWS)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2025-02-26 20:08:39 Re: Parallel CREATE INDEX for GIN indexes
Previous Message Melanie Plageman 2025-02-26 19:54:16 Re: Statistics Import and Export