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 1sizUU-00CKQK-0X for pgsql-hackers@arkaria.postgresql.org; Tue, 27 Aug 2024 16:56:22 +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 1sizUR-009uUU-Dk for pgsql-hackers@arkaria.postgresql.org; Tue, 27 Aug 2024 16:56:19 +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 1sizUR-009uUL-3U for pgsql-hackers@lists.postgresql.org; Tue, 27 Aug 2024 16:56:19 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sizUK-001mqh-Dl for pgsql-hackers@postgresql.org; Tue, 27 Aug 2024 16:56:19 +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 47RGu9pQ3109295; Tue, 27 Aug 2024 12:56:09 -0400 From: Tom Lane To: Robert Haas cc: "pgsql-hackers@postgresql.org" Subject: Re: allowing extensions to control planner behavior In-reply-to: References: <2909615.1724693854@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Tue, 27 Aug 2024 11:45:00 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3109293.1724777769.1@sss.pgh.pa.us> Date: Tue, 27 Aug 2024 12:56:09 -0400 Message-ID: <3109294.1724777769@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Robert Haas writes: > In that vein, here's a new patch set where I've added a second patch > that allows extensions to control choice of index. I'm minus-several on this bit, because that is a solved problem and we really don't need to introduce More Than One Way To Do It. The intention has always been that get_relation_info_hook can editorialize on the rel's indexlist by removing entries (or adding fake ones, in the case of hypothetical-index extensions). For that matter, if you really want to do it by modifying the IndexInfo rather than deleting it from the list, that's already possible: just set indexinfo->hypothetical = true. regards, tom lane