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 1js8ZS-0002HP-FW for pgsql-hackers@arkaria.postgresql.org; Sun, 05 Jul 2020 17:36:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1js8ZR-0006sl-Dl for pgsql-hackers@arkaria.postgresql.org; Sun, 05 Jul 2020 17:36:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1js8ZR-0006se-6l for pgsql-hackers@lists.postgresql.org; Sun, 05 Jul 2020 17:36:53 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1js8ZK-0001yL-EC for pgsql-hackers@lists.postgresql.org; Sun, 05 Jul 2020 17:36:52 +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 065Hahgb1301904; Sun, 5 Jul 2020 13:36:44 -0400 From: Tom Lane To: Stephen Frost cc: pgsql-hackers@lists.postgresql.org, Etsuro Fujita , Jeff Janes Subject: Re: Ideas about a better API for postgres_fdw remote estimates In-reply-to: <20200705170601.GD3125@tamriel.snowman.net> References: <1155731.1593832096@sss.pgh.pa.us> <20200705170601.GD3125@tamriel.snowman.net> Comments: In-reply-to Stephen Frost message dated "Sun, 05 Jul 2020 13:06:01 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1301902.1593970603.1@sss.pgh.pa.us> Date: Sun, 05 Jul 2020 13:36:43 -0400 Message-ID: <1301903.1593970603@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Stephen Frost writes: > * Tom Lane (tgl@sss.pgh.pa.us) wrote: >> * Rather than adding a core-server feature, the remote-end part of the new >> API should be a function installed by an extension (either postgres_fdw >> itself, or a new extension "postgres_fdw_remote" or the like). > I'm trying to figure out why it makes more sense to use > 'postgres_fdw_support(query text)', which would still do parse/plan and > return EXPLAIN-like data, rather than having: > EXPLAIN (FORMAT JSON, FDW true) query ... I see a couple of reasons not to do it like that: 1. This is specific to postgres_fdw. Some other extension might want some other data, and different versions of postgres_fdw might want different data. So putting it into core seems like the wrong thing. 2. Wedging this into EXPLAIN would be quite ugly, because (at least as I envision it) the output would have just about nothing to do with any existing EXPLAIN output. 3. We surely would not back-patch a core change like this. OTOH, if the added infrastructure is in an extension, somebody might want to back-patch that (even if unofficially). This argument falls to the ground of course if we're forced to make any core changes to be able to get at the data we need; but I'm not sure that will be needed. regards, tom lane