Re: No Timeout in SELECT..FOR UPDATE - Mailing list pgsql-hackers

From Tom Lane
Subject Re: No Timeout in SELECT..FOR UPDATE
Date
Msg-id 26055.1076948176@sss.pgh.pa.us
Whole thread Raw
In response to Re: No Timeout in SELECT..FOR UPDATE  (Robert Treat <xzilla@users.sourceforge.net>)
List pgsql-hackers
Robert Treat <xzilla@users.sourceforge.net> writes:
> On Sunday 15 February 2004 16:36, Tom Lane wrote:
>> Not so.  See the statement_timeout parameter.

> what is needed i think is a lock_timeout, which times out soley for
> cases where the lock can not be aquired in a speedy manner.

I didn't say that there wasn't room for improvement, I was just
responding to the OP's assertion that there is "NO WAY" to do it now.

In practice though I think that a statement_timeout solves the problem
well enough.  The sort of command you are going to be worried about is
something like a SELECT ... FOR UPDATE with a simple WHERE condition,
and if the normal (unblocked) execution time isn't very much less than
your expected maximum transaction time then you've got problems anyway.
Whatever sort of timeout you use, you'd have to set at some multiple of
the expected max transaction time unless you want to get unnecessary
failures.  So it seems to me that there's plenty of daylight there,
and relatively little need for a per-lock timeout.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: [PATCHES] dollar quoting
Next
From: markw@osdl.org
Date:
Subject: Re: Proposed Query Planner TODO items