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 1pXbsP-0003kY-VI for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Mar 2023 05:53:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pXbsN-0006ba-Hb for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Mar 2023 05:53:11 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXbsN-0006bR-76 for pgsql-hackers@lists.postgresql.org; Thu, 02 Mar 2023 05:53:11 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXbsK-0005Z6-V0 for pgsql-hackers@postgresql.org; Thu, 02 Mar 2023 05:53:10 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 993D85C010F; Thu, 2 Mar 2023 00:53:07 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 02 Mar 2023 00:53:07 -0500 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:sender :subject:subject:to:to; s=fm1; t=1677736387; x=1677822787; bh=Bn 8HuRKA9C5QPn6AXyxvhHdqxqxcZ1jLK+ql6dp57qE=; b=ubvuz9YIV8bQ5MeoZp BhXEG1EyKOpA36m1ZdgmfLmdTYYsxQrh52p+nvmYZlgMdiwfn3uUWm3iIskbIFlJ 68Rfx9k5MnjnorqrUsCRRvgkIACUDSzpoV8Ma+En+tDqGvokYBB8L3M1mpJ+s1ak J/NbD0cQ6qFiU7WiQoxqLdwh8YbAo2hTx0A6mWD60oL9PmoC5LDT9eSbkyULVsG9 NVId9Z7WhKTpiAMFH33+Bs6vHJ4qB2MAJJ+a7d1itTnpsgNGN4lQeb5pfts47xrB rpLHyDsztlOaubkGrgCoIAb1fvVjWqOUAVvKrHa1mpH2AMF+e/NEsepS8ETXtXPL jlZQ== 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:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1677736387; x=1677822787; bh=Bn8HuRKA9C5QP n6AXyxvhHdqxqxcZ1jLK+ql6dp57qE=; b=hC1eoKW/rtWrKrM6QBOurJj1f9DP5 GQpee/jSVhehzI7cHWr5g2/+FNIdxORWFhCegQvx9UAoBpG3iPeOnpKuAbtH1qQX tNtgI8GWUTN6pS0qx/usgoiHDZX+B+co1irsix4MejJrdHqnyh/RUW+PiGoEaB/h FegDmTU+FXAFWJ0S3ULQct5JEZnLCW0fxyILVpjQ2aQp8Vol3QxHy/yfFTk5UXVD jvprWrnYh0jJr9zkZINj9gQcN61iKm3RYcphktpTd9MYmiIuZkDPVBMXir0GbtQR kQUbd59OImXw38TrMLqIuOl+FlprXyo/9YsR97sGjHJRQO9xo7KHA8VLQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudeliedgkeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeg geegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 2 Mar 2023 00:53:05 -0500 (EST) Date: Thu, 2 Mar 2023 14:53:02 +0900 From: Michael Paquier To: Nathan Bossart Cc: vignesh C , pgsql-hackers@postgresql.org Subject: Re: add PROCESS_MAIN to VACUUM Message-ID: References: <20221230000028.GA435655@nathanxps13> <20230107050724.GA914213@nathanxps13> <20230119190807.GA4062411@nathanxps13> <20230301172637.GA1456203@nathanxps13> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Ur4zJ8kny/WQlDpy" Content-Disposition: inline In-Reply-To: <20230301172637.GA1456203@nathanxps13> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Ur4zJ8kny/WQlDpy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 01, 2023 at 09:26:37AM -0800, Nathan Bossart wrote: > Thanks for taking a look. >=20 > On Wed, Mar 01, 2023 at 03:31:48PM +0900, Michael Paquier wrote: > > PROCESS_TOAST has that: > > /* sanity check for PROCESS_TOAST */ > > if ((params->options & VACOPT_FULL) !=3D 0 && > > (params->options & VACOPT_PROCESS_TOAST) =3D=3D 0) > > ereport(ERROR, > > (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), > > errmsg("PROCESS_TOAST required with VACUUM FULL"))); > > [...] > > - if (params->options & VACOPT_FULL) > > + if (params->options & VACOPT_FULL && > > + params->options & VACOPT_PROCESS_MAIN) > > { > >=20 > > Shouldn't we apply the same rule for PROCESS_MAIN? One of the > > regression tests added means that FULL takes priority over > > PROCESS_MAIN=3DFALSE, which is a bit confusing IMO. =20 >=20 > I don't think so. We disallow FULL without PROCESS_TOAST because there > presently isn't a way to VACUUM FULL the main relation without rebuilding > its TOAST table. However, FULL without PROCESS_MAIN can be used to run > VACUUM FULL on only the TOAST table. - if (params->options & VACOPT_FULL) + if (params->options & VACOPT_FULL && + params->options & VACOPT_PROCESS_MAIN) Perhaps this is a bit under-parenthesized, while reading through it once again.. + { + /* we force VACOPT_PROCESS_MAIN so vacuum_rel() processes it */ + bool force_opt =3D ((params->options & VACOPT_PROCESS_MAIN) =3D=3D = 0); + + params->options |=3D VACOPT_PROCESS_MAIN; vacuum_rel(toast_relid, NULL, params, true); + if (force_opt) + params->options &=3D ~VACOPT_PROCESS_MAIN; Zigzagging with the centralized VacuumParams is a bit inelegant. Perhaps it would be neater to copy VacuumParams and append VACOPT_PROCESS_MAIN on the copy? An extra question: should we check the behavior of the commands when applying a list of relations to VACUUM? -- Michael --Ur4zJ8kny/WQlDpy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmQAOb4ACgkQnvQgOdby QH0vMA/9E6gZwBs6NqcyHCzRi7Y0p3sEjtyRG1Jdmu6IhW3RFNxasMmV6rPo7qKN QwcPRKqw0U2wlKGiQINkRZW4L4f5dvlInQ/ePfUhPjrqkTXJpW/+sku5pl72kBBz lF3+YIkCOPmI9eNxNbU/yOSBn20f1+EY4EGQ0GO+hLMfmjgBkN0cWwKFaqkxz3Gs HIT/jsKPMqxH5YNyyqo899xQMTDaQuHQnSB6itbP6wS3poX4q6T5p0F2bJ4T6tJr +8nXhpe6oO7e+gS4oe/rT1pf7f0BnyJAxzMAcE14wLuGkb7p1vF5HV8KFoEeE5SV CvUt013cUJ0Cy6Dmd5WxcJrwhu+68TbY3brp72p6B6isgTic/Kzj6pd+B9q1q8L9 jnd7tOrddjrEvhij1TTLObSJLHeJ9qat2Cc/Y6fMrvIZ3nRBB77OirKLElJac2zQ tpIaCqSUhaGdjver+msyjvTdz8cCPdV0RlvQO+STmslKaxTAgvIPAkuWNqaqtKjI /VThP9Mt499Gap57TKJwVjMqzqrwsjBU6oRyWQ9Q7sFoPgZL3FH1TE3JZ6m/bHKm pJY6JvBujW+3+dxtoaqLnrmeR+vkUtjI7+09GzcCQUFn3LbmsaHeD0L5C+26lJnh zTkWiWxJ2YW83IRZbuMYuHpj6al6RJTpROhKYyfcqdSdMGFrqS4= =Pn2W -----END PGP SIGNATURE----- --Ur4zJ8kny/WQlDpy--