Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uSQeT-007OPt-HQ for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Jun 2025 01:34:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uSQeQ-00FwU7-2H for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Jun 2025 01:34:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uSQeP-00FwTx-7Q for pgsql-hackers@lists.postgresql.org; Fri, 20 Jun 2025 01:34:42 +0000 Received: from fout-b5-smtp.messagingengine.com ([202.12.124.148]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uSQeM-0032ka-2C for pgsql-hackers@postgresql.org; Fri, 20 Jun 2025 01:34:41 +0000 Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfout.stl.internal (Postfix) with ESMTP id 1315F11401E7; Thu, 19 Jun 2025 21:34:36 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-08.internal (MEProxy); Thu, 19 Jun 2025 21:34:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1750383274; x=1750469674; bh=LxNvv28rwG Z+pgbjLlbtcCYD2Av6PTBHJ7ojLPs3kts=; b=gLo87+lVtMT3ROKQlIloximv+D jD0Kf+h5Se0VGgPBOInT5zLhG78uP8soYJu+kv+ajDT17Nar8BcTlyyxd4AcoTEc HpDwG1jYenCV3o9uXgVgORxDGGuqfd/1HuxY5wXYgMX/+//70UjR45EWobVgBQQi +KsXlKYJe6w2iOi3sQa2eKYPH+H2Koo4pJkY8d72UJg1ZGnL3iPDfbcREu7o8TrH mpwj4WiY1jaR7/SIz/sNOJBpf9R393rI5xbZ2icUYA0k7cByORAdKpYY9VAClzFR qpZS30Itk06b1rNVJawselNRUiKfEGu0EuITjxRAQqMN2bfaFv4YTR1gN98g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1750383274; x=1750469674; bh=LxNvv28rwGZ+pgbjLlbtcCYD2Av6PTBHJ7o jLPs3kts=; b=rFIbwhnZCFs6L8SopZVHN5D9dhKSYG5PXF/s6bsLfvRvOHMgpo/ SB8/MZbuctd+ZRoBvjoJPOO2/2U7OhGd+8H++YiGTke5gz6O+Yi1oo3asBysNvSr H95kqlvNcdSjk7lIxSQ4HafRSxTzrEteUTfhgIp+Ia3leEvsttUtxD16tqft0jGc ncrqd889G4hNZnc97bQfOCtHP9XdaAlZTS+wfHZ+LZWpAwTSFc4TCyyvRp14HG32 4cJqxo014k+gzAH5l8Fyie+IyFxgyMlNgRNfuFtEKS1GuGi9pdZYTHvmC25MP2CH mCViHUUXONGeUExk4Med+3i36yhABTCs/9Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddvgdejtdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrhhluc fvnfffucdlfeehmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecu hfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqhhuih gvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteetgedvvdevueeiudduveekffevvedt udelheellefftddvgeefgedtjeettdeknecuffhomhgrihhnpehpohhsthhgrhdrvghsne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghh rggvlhesphgrqhhuihgvrhdrgiihiidpnhgspghrtghpthhtohepfedpmhhouggvpehsmh htphhouhhtpdhrtghpthhtohepnhgrthhhrghnuggsohhsshgrrhhtsehgmhgrihhlrdgt ohhmpdhrtghpthhtohepiihhohhnghelhedtgeduleesghhmrghilhdrtghomhdprhgtph htthhopehpghhsqhhlqdhhrggtkhgvrhhssehpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Jun 2025 21:34:33 -0400 (EDT) Date: Fri, 20 Jun 2025 10:34:19 +0900 From: Michael Paquier To: Nathan Bossart Cc: shihao zhong , PostgreSQL-development Subject: Re: Fixes inconsistent behavior in vacuum when it processes multiple relations Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qzwoxyrzjIJdot+n" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --qzwoxyrzjIJdot+n Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 19, 2025 at 03:30:26PM -0500, Nathan Bossart wrote: > After thinking about this some more, I'm wondering if it would be better = to > pursue option (2) because it's a little less invasive (which is important > because this will need to be back-patched). In any case, we have a simil= ar > problem when recursing to the TOAST table, which can be fixed by copying > the params at the top of vacuum_rel(). >=20 > While testing out the attached patch, I noticed a couple of other > interesting problems in this area [0]. >=20 > [0] https://postgr.es/m/aFRxC1W_kZU9OjJ9%40nathan Hmm. I like the simplicity of option 2) for the purpose the back branches and the post-feature-freeze v18. However, Option 1) would be my go-to option for HEAD (as of v19 opening for business), but I think that we should harden the code more than suggested and treat all VacuumParams as purely input arguments rather keeping some pointers to it depending on the code path we are dealing with, so as no callers of these inner routines is surprised by changes that may happen internally. Hence, reading the code of v2, I'd suggest to apply the same rule to vacuum_get_cutoffs(), do_analyze_rel() and heap_vacuum_rel(). Except if I am missing something, it looks like all these calls should be OK with this new policy. This implies also changing relation_vacuum() in tableam.h, which can be a HEAD-only change anyway. -- Michael --qzwoxyrzjIJdot+n Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmhUupsACgkQnvQgOdby QH220A/+PezhKyyEeeahk6/btQG03LYhJ7qJM0GyuFCkm5pmKWWA/0jh8WocjZAX YZ0Ja6B4+CJb0NN0ORbWM/WcWParFz0xILc4ZIiSCbMtznWgMvFYl7poNVGzEQIq 6gW96kcsXZgdN7poIzn2BG9PL6BXaSSWG5nQniYOht1ULBWR91panccFZjKU236R rq4w9UbesQFNI3rqgqtvqXK8wkF1cP1rxxdWHwB76XEUzx/PoOnu4RShISa7eUVB CO9ZFDo9ICiPzo6L1C4ex6W4p3MJf9pMmlJ1neTlpaF4GsqMNDITS5exmnJ4RnR0 eqXIoou0UU50GpcI+jwLoSj0/pbHHwQg6XTmJ8BAY/9z/m4tQ98f5Xh45MBsvTkF 1WaVbgiNN8xtB0gKVpyKBNMd5hH+irgKLRrHky79v5+nNE0s4lxHVmd/47Y0QvOY 3yjwNZVV9UZ6wrsgaNsnS0zVTvYrhl2ZfMbMuy4/9eUauzoBMRUqFcJwYwPV0hgQ 0Y5BbafaqIw3a1zZW/P4PL6sSzV2iCNb+MlR0qbBNuO9eOv+05LIgWJk8781ZkNs jKFS0XH8kUUD5nO+7dAwklOSzMkx4FYzXRSjGV+3Y5SyncR74Cq2IypuYG25oBE4 8jVn64/BM+5tNzjSzAI7ImK7cSX5xIFhKF+1jReCvZzWmSCjyhg= =FiYH -----END PGP SIGNATURE----- --qzwoxyrzjIJdot+n--