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 1tqIa7-002cAl-4a for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Mar 2025 21:16:39 +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 1tqIa4-009EDI-44 for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Mar 2025 21:16:36 +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 1tqIa3-009ED9-F8 for pgsql-hackers@lists.postgresql.org; Thu, 06 Mar 2025 21:16:35 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tqIa1-001NDp-1T for pgsql-hackers@lists.postgresql.org; Thu, 06 Mar 2025 21:16:34 +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 526LGRLm899470; Thu, 6 Mar 2025 16:16:27 -0500 From: Tom Lane To: Robert Haas cc: Jeff Davis , Thom Brown , PostgreSQL Hackers Subject: Re: making EXPLAIN extensible In-reply-to: References: <5bbca514250c1f8ee45f08ada94184b0ae109fe9.camel@j-davis.com> <82f96eed213c8d76b36b8a3f504576e5af493270.camel@j-davis.com> <339167.1741200807@sss.pgh.pa.us> <476382.1741208421@sss.pgh.pa.us> <480078.1741210736@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Thu, 06 Mar 2025 15:23:34 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <899468.1741295787.1@sss.pgh.pa.us> Date: Thu, 06 Mar 2025 16:16:27 -0500 Message-ID: <899469.1741295787@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Robert Haas writes: > If there is, maybe we should discard the integer IDs and just use > strings directly. I could make GetExplainExtensionState() and > SetExplainExtensionState() take const char *extension_name arguments > instead of int extension_id, and just get rid of GetExplainExtensionId > entirely. I chose the current design because I thought that the IDs > did not need to be shared and I thought it would be a bit extravagant > to have an EXPLAIN extension need to do a hash table lookup for every > plan node, but maybe it wouldn't really matter in practice. I find a good deal of attraction in getting rid of the IDs and just using names. Nor do I believe we need a hash table. (1) Surely there will not be so many extensions using this within a single EXPLAIN that a simple loop with strcmp()'s isn't good enough. (2) The IDs aren't free either; where will an extension keep the ID it assigned? We're trying to move away from global variables. But, if you're convinced otherwise, the current design is OK. Other than that point, I think 0001 and 0002 are ready. > Regarding commit timeframe, you expressed a preference for 0001 and > 0002 to be committed "soon," but I'm going to be leaving town for a > week on Saturday and would prefer not to put myself in a situation > where somebody is expecting me to fix the buildfarm while I am gone. > So I'm happy to commit them today or tomorrow if you don't mind being > responsible for anything that blows up while I'm gone, or I'm happy to > have you commit them whenever you want, but barring one of those > outcomes, I'm going to deal with it on or after March 17th. Sure, I will backstop you if you want to push and run. There's at least one nearby thread where some interest has been expressed in using this (the postgres_fdw include-the-remote-EXPLAIN business). So I think there is value in having it in the tree sooner. regards, tom lane