Re: [ADMIN] Vacuum error on database postgres

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: andy <andy(at)squeakycode(dot)net>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [ADMIN] Vacuum error on database postgres
Date: 2006-09-14 23:40:17
Message-ID: 1158277217.29889.146.camel@dogma.v10.wvs
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

On Thu, 2006-09-14 at 18:25 -0400, Tom Lane wrote:
> Jeff Davis <pgsql(at)j-davis(dot)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.
>

Couldn't you just sort by the table names, and ANALYZE the tables in
that order? Would that effectively prevent the deadlocks?

Regards,
Jeff Davis

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2006-09-14 23:50:58 Re: [ADMIN] Vacuum error on database postgres
Previous Message Tom Lane 2006-09-14 22:25:42 Re: [ADMIN] Vacuum error on database postgres

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-09-14 23:45:24 Re: Lock partitions
Previous Message Bruce Momjian 2006-09-14 22:53:38 Re: Release notes