Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p6HOr-0000gQ-Ru for pgsql-bugs@arkaria.postgresql.org; Fri, 16 Dec 2022 20:33:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p6HOq-00068Y-EG for pgsql-bugs@arkaria.postgresql.org; Fri, 16 Dec 2022 20:33:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p6HOq-00064x-62 for pgsql-bugs@lists.postgresql.org; Fri, 16 Dec 2022 20:33:44 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p6HOl-0005lr-AS for pgsql-bugs@lists.postgresql.org; Fri, 16 Dec 2022 20:33:41 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 2BGKXX3D3843993; Fri, 16 Dec 2022 15:33:34 -0500 From: Tom Lane To: Peter Geoghegan cc: postgresql@taljaren.se, pgsql-bugs@lists.postgresql.org, Michael Paquier Subject: Re: BUG #17717: Regression in vacuumdb (15 is slower than 10/11 and possible memory issue) In-reply-to: References: <17717-6c50eb1c7d23a886@postgresql.org> <3439037.1671130590@sss.pgh.pa.us> <3544447.1671141436@sss.pgh.pa.us> <3672943.1671202149@sss.pgh.pa.us> Comments: In-reply-to Peter Geoghegan message dated "Fri, 16 Dec 2022 10:47:07 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3843991.1671222813.1@sss.pgh.pa.us> Date: Fri, 16 Dec 2022 15:33:33 -0500 Message-ID: <3843992.1671222813@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Geoghegan writes: > On Fri, Dec 16, 2022 at 6:49 AM Tom Lane 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