Re: Cost limited statements RFC - Mailing list pgsql-hackers

From Claudio Freire
Subject Re: Cost limited statements RFC
Date
Msg-id CAGTBQpYnSY9D-8cPRju-SVrBpsswTzF6X9g6sg_AsVyyXrGSkA@mail.gmail.com
Whole thread Raw
In response to Cost limited statements RFC  (Greg Smith <greg@2ndQuadrant.com>)
Responses Re: Cost limited statements RFC  (Greg Smith <greg@2ndQuadrant.com>)
List pgsql-hackers
On Thu, May 23, 2013 at 8:27 PM, Greg Smith <greg@2ndquadrant.com> wrote:
> The main unintended consequences issue I've found so far is when a cost
> delayed statement holds a heavy lock.  Autovacuum has some protection
> against letting processes with an exclusive lock on a table go to sleep.  It
> won't be easy to do that with arbitrary statements.  There's a certain
> amount of allowing the user to shoot themselves in the foot here that will
> be time consuming (if not impossible) to eliminate.  The person who runs an
> exclusive CLUSTER that's limited by statement_cost_delay may suffer from
> holding the lock too long.  But that might be their intention with setting
> the value.  Hard to idiot proof this without eliminating useful options too.


Why not make the delay conditional on the amount of concurrency, kinda
like the commit_delay? Although in this case, it should only count
unwaiting connections.

That way, if there's a "delay deadlock", the delay gets out of the way.



pgsql-hackers by date:

Previous
From: Greg Smith
Date:
Subject: Cost limited statements RFC
Next
From: Greg Smith
Date:
Subject: Re: Cost limited statements RFC