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 17022.1158277858@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
List pgsql-hackers
Jeff Davis <pgsql@j-davis.com> writes:
> Couldn't you just sort by the table names, and ANALYZE the tables in
> that order? Would that effectively prevent the deadlocks?

That'd work too, I think (I suggested the variant of ordering by OID,
which is simpler and more reliable).  Not sure if it's really worth the
trouble though --- how many people do you think are doing concurrent
whole-database ANALYZEs inside transaction blocks?

As-is the code will do the analyzes in pg_class physical row order,
which is almost good enough --- only if someone did a schema change that
forced a pg_class row update between the starts of the two ANALYZE runs
would it possibly fail.  So the use-case for a fix is really kinda narrow.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Lock partitions
Next
From: Bruce Momjian
Date:
Subject: Re: Draft release notes