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 1rhdXg-00CbQP-3D for pgsql-bugs@arkaria.postgresql.org; Tue, 05 Mar 2024 22:45:49 +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 1rhdXe-003NpG-0b for pgsql-bugs@arkaria.postgresql.org; Tue, 05 Mar 2024 22:45:46 +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 1rhdXc-003Np8-Gb for pgsql-bugs@lists.postgresql.org; Tue, 05 Mar 2024 22:45:46 +0000 Received: from fout1-smtp.messagingengine.com ([103.168.172.144]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rhdXY-002yDS-NJ for pgsql-bugs@lists.postgresql.org; Tue, 05 Mar 2024 22:45:44 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.nyi.internal (Postfix) with ESMTP id 0C79413800DC; Tue, 5 Mar 2024 17:45:38 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 05 Mar 2024 17:45:38 -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:subject :subject:to:to; s=fm1; t=1709678738; x=1709765138; bh=CD9biJRPWq t8hdLL3iyd8+dxM4ww5PNWwZ/buZLd860=; b=PrL9ny81kl9ay66ecgsCGlxr38 rZo8QS0TphNYWw3kQ4wSge5uVp0kPY8WkRWYQWfdeDXbqy2xRxaKYKOq5CrWysmQ +9v4dAPU91r2+hjdSVu+ht9nEsLdhzpz6FViWrUFk5zNY0Ia3ufuOcspNlreOQki Fy/U60WnkZKSA3owD63oVin1Ug+Al3d0oQuLDBGNZBLKk7gNFc9vQNJ3CyCjrJb2 3QJy9UAqVckrLVwZW1eATCAbGHETegnEkBxuMfWz1Sxtqrmd2BT4c10WZ/CZW+xW EUGV56F51gZgO8aovVbaE2Hy2Ss1TB9j18EVot2X30HNQXG9gRKIF/qkBl6A== 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-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1709678738; x=1709765138; bh=CD9biJRPWqt8hdLL3iyd8+dxM4ww 5PNWwZ/buZLd860=; b=pECDTVY9nG946oXyGj9VgPpDP5r/V4grrlEgn0W7jhp3 3BlVDrqBVaTXQKCdu3j510C8kwe1eh44+gC+SmhioG3NX4YwxqhEN3QMfIBEbTnT ubgdtuoGsN6Gf6eWpkD/c/7LotZag0rKpO/CaPv969ht2HtobmzmPpY+MrUBiIX7 jbQfPau4lOeeyEWm0edXz986NyJjuxHGSGuaIE94IZp464WjMWlyQIBUkCDzwJNK cxQnC/nR4CUukzFqfnEeUePi1Vtzri7C3kYH5MnGQYYy0alD9kBbNR3C5ti82xKU xGY4aH3ziZHCmFVHqF22n8BQ9uJY6tfCfxZRpqA9Pg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledriedtgddtvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeg geffhfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 5 Mar 2024 17:45:35 -0500 (EST) Date: Wed, 6 Mar 2024 07:45:21 +0900 From: Michael Paquier To: jian he Cc: Tender Wang , pgsql-bugs@lists.postgresql.org, Alexander Lakhin Subject: Re: BUG #18314: PARALLEL UNSAFE function does not prevent parallel index build Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="KPAV0nDu99/TxYWE" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --KPAV0nDu99/TxYWE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 05, 2024 at 09:22:08PM +0800, jian he wrote: > in RelationGetIndexClause to, I think you can use the following to > save a SearchSysCache1 cycle? > if (relation->rd_indextuple =3D=3D NULL || > heap_attisnull(relation->rd_indextuple, Anum_pg_index_indexprs, NULL)) > return NIL; >=20 > or > if (relation->rd_indextuple =3D=3D NULL || > heap_attisnull(relation->rd_indextuple, Anum_pg_index_indpred, NULL)) > return NIL; Don't think so. The point is to not rely on the relcache at all to retrieve this information. > main question would be why not two functions, > like RelationGetIndexRawExpr(Relation relation), > RelationGetIndexRawPred(Relation relation) This comes down to if it is clean to have references to the catalog pg_index in the planner, which is not the case yet so my take is that two functions is much cleaner even if both return a List. Anyway, why do you insist in putting the new functions in relcache.c? I would suggest to move that to lsyscache.c instead, close to get_index_column_opclass where there are routines for the syscache of pg_index. It would be possible to reuse that in the reindex code, for example. The patch should add a comment in in plan_create_index_workers() explaining why we care about raw expressions and indexes rather than the relcache information. -- Michael --KPAV0nDu99/TxYWE Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmXnoIEACgkQnvQgOdby QH0SiQ/6AoxP5IpRy6aDiviZ6G4nxJdnv22BxXCR+cdh+1O5R6pK1nvhsT4g8XNJ J4fQFs4WRdBbVl3zyOvpTnxDGxaUcApMA6fBfysF2bHN6wXvff0FnAv/OvFs31CO BAi/ezQGrAu17GEIQ8obZPFoBI78/q7pvkYCdbm0agSWnQae44qPi8GNndj6Wvbs DgE0bRJjxFrqs8h9vZWEs2RxDuP7SgdCxCKj2fSg44+DK/3KLQmbbKe9I6+Zdr6X mVYm+6PsEmdvMhUuiEa8khtwBprspxgTDupRUyY59zVJtBunZ4rtBZSO50TXFIf/ MLqCZI9gWMeY13AeTGV77Zzt6OkmlKtTCB13nHA2j5Y9I9dW4Zd2VYF6RGUZzaQq olysuPQcTYIqeLxxnA5CjPsMX9UXlnpdxHL6CThTCPUSSbFgTx++dCYstAnsp9E/ BG8Jxgd48hC4na6Jmjcba394m8Z1ZkaPXdVYwJL6gmJTAt7Bp/tVwwVQUfOXvuYF /OPZjxNSzAwYDrT/3VRNIt3T9PemiaU3wtjke1z87ZiHF4b3xn9SQcc1H4xRz33H z6zByTcgqIHFNEtO87TpWs1RRCosS/s8BpFSPt0ae9w/aI/228QqxHTMdBtkyk2h sWzbs78SArpoMOH8ePf4Z89UWvV84qQwWnmm/gga0zggZ2GMf3U= =+oo6 -----END PGP SIGNATURE----- --KPAV0nDu99/TxYWE--