Re: PostgreSQL 17 Beta 1 release announcement draft - Mailing list pgsql-hackers

From Bertrand Drouvot
Subject Re: PostgreSQL 17 Beta 1 release announcement draft
Date
Msg-id ZksZKCVQah1yROX5@ip-10-97-1-34.eu-west-3.compute.internal
Whole thread Raw
In response to Re: PostgreSQL 17 Beta 1 release announcement draft  ("Jonathan S. Katz" <jkatz@postgresql.org>)
Responses Re: PostgreSQL 17 Beta 1 release announcement draft
List pgsql-hackers
Hi,

On Sun, May 19, 2024 at 05:10:10PM -0400, Jonathan S. Katz wrote:
> On 5/16/24 1:15 AM, Bertrand Drouvot wrote:
> > Hi,
> > 
> > On Wed, May 15, 2024 at 09:45:35PM -0400, Jonathan S. Katz wrote:
> > > Hi,
> > > 
> > > Attached is a copy of the PostgreSQL 17 Beta 1 release announcement draft.
> > 
> > Thanks for working on it!
> > 
> > I've one comment:
> > 
> > > PostgreSQL 17 also introduces a new view,
[`pg_wait_events`](https://www.postgresql.org/docs/17/view-pg-wait-events.html),which provides descriptions about wait
eventsand can be combined with `pg_stat_activity` to give more insight into an operation.
 
> > 
> > Instead of "to give more insight into an operation", what about "to give more
> > insight about what a session is waiting for (should it be active)"?
> 
> I put:
> 
> "to give more in insight into why a session is blocked."

Thanks!

> 
> Does that work?
> 

I think using "waiting" is better (as the view is "pg_wait_events" and the
join with pg_stat_activity would be on the "wait_event_type" and "wait_event"
columns).

The reason I mentioned "should it be active" is because wait_event and wait_event_type
could be non empty in pg_stat_activity while the session is not in an active state
anymore (then not waiting).

A right query would be like the one in [1]:

"
SELECT a.pid, a.wait_event, w.description
  FROM pg_stat_activity a JOIN
       pg_wait_events w ON (a.wait_event_type = w.type AND
                            a.wait_event = w.name)
  WHERE a.wait_event is NOT NULL and a.state = 'active';
"

means filtering on the "active" state too, and that's what the description
proposal I made was trying to highlight.

[1]: https://www.postgresql.org/docs/devel/monitoring-stats.html

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Mark Cave-Ayland
Date:
Subject: Re: commitfest.postgresql.org is no longer fit for purpose
Next
From: Andrei Lepikhov
Date:
Subject: Re: using extended statistics to improve join estimates