Re: Query performance inconsistant.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Matthew Schumacher <matt(dot)s(at)aptalaska(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Query performance inconsistant.
Date: 2006-09-08 16:05:55
Message-ID: 18989.1157731555@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Matthew Schumacher <matt(dot)s(at)aptalaska(dot)net> writes:
> Here is the proc that has very inconsistent (anywhere from 25ms to
> 8000ms) performance:
> ...
> This setup, with concurrency, is returning very inconsistent query
> performance. Sometimes its very fast, other times it's slow and waits.
> This makes me think I have a table locking issue, but I'm not sure
> since pg_locks rarely reports more than this:

Yeah, I suspect a locking issue too, but you won't find out what it is
unless you can capture the content of pg_locks at a time when the proc
is being delayed.

You could try making the proc do
LOCK TABLE ... IN ROW EXCLUSIVE MODE NOWAIT
inside an exception block, catching the error, and logging the contents
of pg_locks to someplace.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message romantercero 2006-09-08 17:44:01 Re: Database design and triggers...
Previous Message Martijn van Oosterhout 2006-09-08 15:47:59 Re: ECPG - how to fetch then sort strings