Re: Blocking excessively in FOR UPDATE - Mailing list pgsql-performance

From Tom Lane
Subject Re: Blocking excessively in FOR UPDATE
Date
Msg-id 19908.1320363946@sss.pgh.pa.us
Whole thread Raw
In response to Re: Blocking excessively in FOR UPDATE  (Claudio Freire <klaussfreire@gmail.com>)
Responses Re: Blocking excessively in FOR UPDATE
List pgsql-performance
Claudio Freire <klaussfreire@gmail.com> writes:
> On Thu, Nov 3, 2011 at 4:29 PM, Claudio Freire <klaussfreire@gmail.com> wrote:
>> Next time I find it blocking, I will check pg_locks directly and post
>> the output.

> Here it is, two instances of the query, while blocked:

Hmm ... definitely seems that you're not blocked on a FOR UPDATE tuple
lock.  If you were, there'd be an ungranted ShareLock on a transactionid
in there.

It seems possible that you're blocked on an LWLock, which would not show
in pg_locks.  But before pursuing that idea, probably first you should
back up and confirm whether the process is actually waiting, or running,
or just really slow due to CPU contention.  It might be useful to see
what strace has to say about it.

            regards, tom lane

pgsql-performance by date:

Previous
From: CS DBA
Date:
Subject: Re: function slower than the same code in an sql file
Next
From: "Albe Laurenz"
Date:
Subject: Re: SSL encryption makes bytea transfer slow