Re: [ADMIN] Vacuum error on database postgres - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [ADMIN] Vacuum error on database postgres
Date
Msg-id 16508.1158272742@sss.pgh.pa.us
Whole thread Raw
In response to Re: [ADMIN] Vacuum error on database postgres  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: [ADMIN] Vacuum error on database postgres  (Jeff Davis <pgsql@j-davis.com>)
Re: [ADMIN] Vacuum error on database postgres  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-hackers
Jeff Davis <pgsql@j-davis.com> 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.

The whole thing seems a bit too cute/complicated though; it'd open
various corner cases such as: ANALYZE, run complex query, query takes a
week because it's using out-of-date stats because previous ANALYZE-r
hadn't committed yet.  I'd rather ANALYZE always analyzed than sometimes
fell through without doing anything.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Release notes
Next
From: Bruce Momjian
Date:
Subject: Re: Release notes