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 1sjT27-000ygd-Q1 for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Aug 2024 00:29:03 +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 1sjT24-00CQQv-Rb for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Aug 2024 00:29:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sjT24-00CQQk-GA for pgsql-hackers@lists.postgresql.org; Thu, 29 Aug 2024 00:29:01 +0000 Received: from fhigh6-smtp.messagingengine.com ([103.168.172.157]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sjT22-001veh-1P for pgsql-hackers@postgresql.org; Thu, 29 Aug 2024 00:28:59 +0000 Received: from phl-compute-06.internal (phl-compute-06.nyi.internal [10.202.2.46]) by mailfhigh.nyi.internal (Postfix) with ESMTP id AA0051151AEF; Wed, 28 Aug 2024 20:28:56 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Wed, 28 Aug 2024 20:28:56 -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=1724891336; x=1724977736; bh=Ix++U7lbUv lpkTm30LWeDu9onIqQYKR2kYoqph886G4=; b=gcVIJzxFKVUsTaqf22q6aWzkn0 BMhtv/TMBQ44Ui9XqMWnDzvij64Qg+I30FoTMOJiq1SCFjd1MYyRS+LhO/RxVJph yQSs1fpVA5hrGkZOj6emt6iEerLLY6tVIDtf9Rzyi1rKDr1B4REs+KaKRJRBcPpd SNtm9hogtWl8hoFOpit5VIIbIJ0bzJr+vPmyuXM5Gwme+bGaFM0gXDEvvRCl6BNb wEVaZUGvBLzNzxwdrD6aCaedL6XFxT4fCiX9FZ3ZtccqamBT+Hta52DN2RPDPtjj yH1X2TzGvPGRMPPMuDjC/8h3DO94+NMb5ib5cTbBvqJLkneQ2qmEJFDtq6uQ== 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=1724891336; x=1724977736; bh=Ix++U7lbUvlpkTm30LWeDu9onIqQ YKR2kYoqph886G4=; b=KSaiRPuuLwoesnfSuO6DwqvC6s5KCRXhlgGjvxaPkdcR aE5jYuMsVRrdeOOayBUamagYCt1dKCa/43sc9dXte6lQ8qLI89bjmeWB1L6kCFgQ VArsYrI1Ewc9VU0ktXyzhPOnRIvgES1n7wB17No+PzDwymFrKyjS9/mHQI19/kQV h9HPDxJUFK3OorP9SYdT0j32Nsgl6XewbzBiW2rTz9G0hq/M6tuAflIfmI+oVWrS CnnAz90HJr4U2/hSfH63sLPdUyNQxkR0nuxqKKMd9B/0hUXvFiIKDqlpiX7lRx4a LZHTePxW7WtGvF1MO/D/DiOrftN9rFYDO3qMcH/KDg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudeffedgfeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnegfrhhlucfvnfffucdlvdefmdenucfjughrpeffhffvvefukfhf gggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruc eomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepkeef keehkeffudeuiefhhfegfeeikeejgedufeduveelvddvfefghfduieefuddvnecuffhomh grihhnpehrvggrughthhgvughotghsrdhiohdpphhoshhtghhrvghsqhhlrdhorhhgnecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrg gvlhesphgrqhhuihgvrhdrgiihiidpnhgspghrtghpthhtohepgedpmhhouggvpehsmhht phhouhhtpdhrtghpthhtohepthhglhesshhsshdrphhghhdrphgrrdhushdprhgtphhtth hopehpghhsqhhlsehjqdgurghvihhsrdgtohhmpdhrtghpthhtoheprhhosggvrhhtmhhh rggrshesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhsse hpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 28 Aug 2024 20:28:54 -0400 (EDT) Date: Thu, 29 Aug 2024 09:28:46 +0900 From: Michael Paquier To: Tom Lane Cc: Jeff Davis , Robert Haas , "pgsql-hackers@postgresql.org" Subject: Re: allowing extensions to control planner behavior Message-ID: References: <95e423ea042a8d2f85c76ee28feb7a5b10265f4d.camel@j-davis.com> <646c3d09475e49a5d1145c91af0ce3fdc3cdee96.camel@j-davis.com> <3496381.1724887559@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="XNyECpL+bTpJiwIq" Content-Disposition: inline In-Reply-To: <3496381.1724887559@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --XNyECpL+bTpJiwIq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 28, 2024 at 07:25:59PM -0400, Tom Lane wrote: > Jeff Davis writes: > > Beyond awkwardness, one case where it matters is the interaction > > between an extension that provides hints and an extension that offers a > > CustomScan. How is the hints extension supposed to disable a path it > > doesn't know about? pg_hint_plan documents its hints here: https://pg-hint-plan.readthedocs.io/en/master/hint_list.html#hint-list Hmm. I think that we should be careful to check that this works correctly with pg_hint_plan, at least. The module goes through a lot of tweaks and is a can of worms in terms of plan adjustments because we can only rely on the planner hook to do the whole work. This leads to a lot of frustration for users because each feature somebody asks for leads to just more tweaks to apply on the paths. The bullet list sent here sounds pretty good to me: https://www.postgresql.org/message-id/3131957.1724789735@sss.pgh.pa.us > This does not seem remarkably problematic to me, given Robert's > proposal of a bitmask of allowed plan types per RelOptInfo. > You just do something like >=20 > rel->allowed_plan_types =3D DESIRED_PLAN_TYPE; >=20 > The names of the bits you aren't setting are irrelevant to you. For the types of scans to use, that would be OK. The module has a feature where one can also have a regex to match for an index, and the module is very funky with inheritance and partitioned tables. How does that help if using a Leading hint to force a join order? That's something people like a lot. But perhaps that's just the part of upthread where we'd need a extra hook? I am not completely sure to get the portion of the proposal for that. add_paths_to_joinrel() has been mentioned, and there is set_join_pathlist_hook already there. -- Michael --XNyECpL+bTpJiwIq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmbPwL4ACgkQnvQgOdby QH2yBQ//RGs7Uupd06ddrZqgxkPRRqXeo0spiyT0BIRu2eKv2fgOJ5gBLo8bk2Y3 p4D6FvNSgO9xO4/csgnQBcCd1gUyEmO6FGkFrsM40buvXagpc4M2t81SuY1kYFBe q9ofadvl359Jm+jO0t0+f/prxWrv+U+5KrZmpJVfO0HaX/jsHXFyAltTCOpKR2am r64No29hK/tAHviiJBmFm1m+XMtpW1ZM+ZM+t++2PHevHd/rQzCGArlizPPya0OB KgEmzh0Jz1ubl1nDIl2iCCTdA+j4TOz7kfiOVWdjennnHv8vjaZvHRECbrripWM3 T/gv2rnnzm5VKncQ73yi/nxhTt2YKM+X7RSxtMBbTLTOnXnRrP2f9R97hpO+nq3Y IKMvvIqP6OkvfGyXbuzos5UpOb9wO8aN9aCfQ27qhuEayEAyYttMgrrg30uclueW l0HbY12IWWgGjXyign33zpQhKbC5OCJ6NNrNtfrqxXQPN+4QBhDG8fHdbpTLCw5r GyeMQWKA2oarR6n/CyepXD3M/FStmi9cik6Xc7s0+sJprfWNaxuWDe8pjmWe080W I2zeJ5iAZ+kgiUI6tlBqN2xdw5UBr0mwYlSwLQO5Qfc73jWnTt8KRUV4MI7Y0hzc ACDb9kjeYW9Y9ARw9WOrCecBRQpJjc8KgVdsWKEIR1MZ0bNRwuk= =zscY -----END PGP SIGNATURE----- --XNyECpL+bTpJiwIq--