On Tue, 3 Feb 2009, Greg Stark wrote:
> Notably, there's no indication of which lock wait queue the ungranted
> locks are in. That means to find out what's blocking a lock would
> require comparing every other lock to it and deciding whether it
> conflicts.
The tool I find myself wanting here would parse pg_locks, find everything
that wasn't granted, scan through looking for the source of contention as
you describe, try to look up what any blockers are doing via
pg_stat_activity, then report on its findings. That's not so difficult to
do by hand that I've bothered automating it completely for the occasional
time this pops up.
--
* Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD