Claudio Freire <klaussfreire@xxxxxxxxx> writes: > On Thu, Nov 3, 2011 at 4:29 PM, Claudio Freire <klaussfreire@xxxxxxxxx> 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 -- Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance