On Thu, Sep 14, 2006 at 06:25:42PM -0400, Tom Lane wrote:
> Jeff Davis <[EMAIL PROTECTED]> writes:
> > How would creating a new lock type avoid deadlocks when an ANALYZE is
> > accumulating the locks in random order?
> 
> In itself it wouldn't.  Josh Drake sketched the idea in more detail
> later: if there is a lock type used *only* for ANALYZE, then you can do
> ConditionalLockAcquire on it, and if you fail, skip the table on the
> assumption that someone else is already doing what you came to do.

Wouldn't it be useful for ANALYZE to do a conditional lock anyway and
skip if it can't acquire. Especially for the analyse-from-autovacuum
case, perhaps an ANALYSE NOLOCK or whatever.

For stuff run from autovacuum, would it be reasonable for the
automatically run version to just abort if it sees someone doing the
same thing?

Have a nice day,
-- 
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to 
> litigate.

Attachment: signature.asc
Description: Digital signature

Reply via email to