Re: RFC: replace pg_stat_activity.waiting with something more descriptive

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: RFC: replace pg_stat_activity.waiting with something more descriptive
Date: 2015-08-26 18:55:58
Message-ID: 20150826185558.GD29674@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jul 27, 2015 at 04:10:14PM -0500, Jim Nasby wrote:
> >>Sure, but I don't think this makes it impossible to figure out who's
> >>locking who. I think the only thing you need other than the data in
> >>pg_locks is the conflicts table, which is well documented.
> >>
> >>Oh, hmm, one thing missing is the ordering of the wait queue for each
> >>locked object. If process A holds RowExclusive on some object, process
> >>B wants ShareLock (stalled waiting) and process C wants AccessExclusive
> >>(also stalled waiting), who of B and C is woken up first after A
> >>releases the lock depends on order of arrival.
> >
> >Agreed - it would be nice to expose that somehow.
>
> +1. It's very common to want to know who's blocking who, and not at
> all easy to do that today. We should at minimum have a canonical
> example of how to do it, but something built in would be even
> better.

Coming in late here, but have you looked at my locking presentation; I
think there are examples in there:

http://momjian.us/main/writings/pgsql/locking.pdf

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2015-08-26 18:58:33 Re: 9.5 release notes
Previous Message Bruce Momjian 2015-08-26 18:47:14 Re: 9.5 release notes