Re: BUG #17717: Regression in vacuumdb (15 is slower than 10/11 and possible memory issue) - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #17717: Regression in vacuumdb (15 is slower than 10/11 and possible memory issue)
Date
Msg-id 3843992.1671222813@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #17717: Regression in vacuumdb (15 is slower than 10/11 and possible memory issue)  (Peter Geoghegan <pg@bowt.ie>)
List pgsql-bugs
Peter Geoghegan <pg@bowt.ie> writes:
> On Fri, Dec 16, 2022 at 6:49 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> That is a really good point.  How about teaching VACUUM to track
>> the oldest original relfrozenxid and relminmxid among the table(s)
>> it processed, and skip vac_update_datfrozenxid unless at least one
>> of those matches the database's values?  For extra credit, also
>> skip if we didn't successfully advance the source rel's value.

> Hmm. I think that that would probably work.

> It would certainly work on 15+, because there tends to be "natural
> diversity" among the relfrozenxid values seen for each table, due to
> the "track oldest extant XID" work; we no longer see many tables that
> all have the same relfrozenxid, that advance in lockstep. But even
> that factor probably doesn't matter, since we only need one "laggard
> relfrozenxid" static table for the scheme to work and work well. That
> is probably a safe bet on all versions, though I'd have to check to be
> sure.

Oh, I see your point: if a whole lot of tables have the same relfrozenxid
and it matches datfrozenxid, this won't help.  Still, we can hope that
that's an uncommon situation.  If we postulate somebody trying to use
scheduled "vacuumdb -z" in place of autovacuum, they shouldn't really have
that situation.  Successively vacuuming many tables should normally
result in the tables' relfrozenxids not being all the same, unless they
were unlucky enough to have a very long-running transaction holding back
the global xmin horizon the whole time.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Vik Fearing
Date:
Subject: Re: BUG #17723: cache lookup failed for type 0
Next
From: "David G. Johnston"
Date:
Subject: Re: BUG #17724: All autovacuum workers operate on 1 db at a time