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 1p6C1f-0000dj-7Y for pgsql-bugs@arkaria.postgresql.org; Fri, 16 Dec 2022 14:49:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p6C1c-0005mk-Oj for pgsql-bugs@arkaria.postgresql.org; Fri, 16 Dec 2022 14:49:24 +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 1p6C1c-0005ma-Hc for pgsql-bugs@lists.postgresql.org; Fri, 16 Dec 2022 14:49:24 +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 1p6C1Z-00025N-IJ for pgsql-bugs@lists.postgresql.org; Fri, 16 Dec 2022 14:49:23 +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 2BGEn97D3672944; Fri, 16 Dec 2022 09:49:09 -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> Comments: In-reply-to Peter Geoghegan message dated "Thu, 15 Dec 2022 20:39:54 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3672942.1671202149.1@sss.pgh.pa.us> Date: Fri, 16 Dec 2022 09:49:09 -0500 Message-ID: <3672943.1671202149@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Geoghegan writes: > On Thu, Dec 15, 2022 at 1:57 PM Tom Lane wrote: >> Or maybe we could modify things so that "autovacuum = off" doesn't prevent >> occasional cycles of vac_update_datfrozenxid-and-nothing-else? > That's what I was thinking of. It seems like a more natural approach > to me, at least offhand. Seems worth looking into. But I suppose the launch frequency would have to be more often than the current behavior for autovacuum = off, so it would complicate the logic in that area. > I have to imagine that the vast majority of individual calls to > vac_update_datfrozenxid have just about zero chance of updating > datfrozenxid or datminmxid as things stand. 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. This might lead to a fix that solves the OP's problem while not changing anything fundamental, which would make it reasonable to back-patch. regards, tom lane