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 1js8kX-0002Yh-Mh for pgsql-hackers@arkaria.postgresql.org; Sun, 05 Jul 2020 17:48:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1js8kW-0002NF-K8 for pgsql-hackers@arkaria.postgresql.org; Sun, 05 Jul 2020 17:48:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1js8kW-0002N8-D7 for pgsql-hackers@lists.postgresql.org; Sun, 05 Jul 2020 17:48:20 +0000 Received: from tamriel.snowman.net ([96.255.250.162]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1js8kU-0004Eo-1O for pgsql-hackers@lists.postgresql.org; Sun, 05 Jul 2020 17:48:19 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 68A335F79F; Sun, 5 Jul 2020 13:48:17 -0400 (EDT) Date: Sun, 5 Jul 2020 13:48:17 -0400 From: Stephen Frost To: Tom Lane Cc: pgsql-hackers@lists.postgresql.org, Etsuro Fujita , Jeff Janes Subject: Re: Ideas about a better API for postgres_fdw remote estimates Message-ID: <20200705174817.GE3125@tamriel.snowman.net> References: <1155731.1593832096@sss.pgh.pa.us> <20200705170601.GD3125@tamriel.snowman.net> <1301903.1593970603@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="J58k4iUnqtw3lv0j" Content-Disposition: inline In-Reply-To: <1301903.1593970603@sss.pgh.pa.us> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --J58k4iUnqtw3lv0j Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Tom Lane (tgl@sss.pgh.pa.us) wrote: > 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). >=20 > > 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: >=20 > > EXPLAIN (FORMAT JSON, FDW true) query ... >=20 > I see a couple of reasons not to do it like that: >=20 > 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. Another extension or use-case might want exactly the same information too though. In a way, we'd be 'hiding' that information from other potential users unless they want to install their own extension, which is a pretty big leap. Are we sure this information wouldn't be at all interesting to pgAdmin4 or explain.depesz.com? > 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. This is a better argument for not making it part of EXPLAIN, though I don't really feel like I've got a decent idea of what you are suggesting the output *would* look like, so it's difficult for me to agree (or disagree) about this particular point. > 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. Since postgres_fdw is part of core and core's release cycle, and the packagers manage the extensions from core in a way that they have to match up, this argument doesn't hold any weight with me. For this to be a viable argument, we would need to segregate extensions from core and give them their own release cycle and clear indication of which extension versions work with which PG major versions, etc. I'm actually generally in support of *that* idea- and with that, would agree with your point 3 above, but that's not the reality of today. Thanks, Stephen --J58k4iUnqtw3lv0j Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJfAhJgAAoJEO1sijiDR2RVt4UP/3Jzkg4WZSoCx3/JT7Fhy36i k9QkBg3pEQ8yWlAt9jCVnN9ibPGUIIboB9NnQASoGaIaO4Goq6AdEnNZLlplTIxt cGHPfugUPuIQruStgqm+UtzEGSCb5d3K4HIprwPj/sk2PgSoBT9splIK0DhzYz5I T62uravEjKgV2yCbBDAFp0bZxQDbtm84tnWcJOgCEZYN4fMfDV6ES9e1btVqstZ2 0pVR8HMEGKLNWZ6NEgZSI+NN10/eDJQPBwXDHWN4EtjPu/QvZMcxOkala956jedG V2MrzRqbXTFNkfTpO8OBElCp2cCjAc1nVJMilpa/Z877SQJColjlOVR9wN282hIm nQo9nY6i5WMPp9vZmZQacRSO+TT1B0gOEysjE1l/sVkk4atj9qK7ipelxeaVfhV7 uJ9TNoFU5xgAZc6b65XKpry/KEWH5jNA42BBrzSXdaPUkXdhcevU1fHACp0GJ5M1 MsRQ8jUmkvIBTdSCJ7qdvp0j3z7ZJIfmF7OTLGWgQaEulz82yASe+7Cajtl9PDwz y48d0DHG7BDveuwTbpZmWAPjPIkrC4spG9sOVnOHg+R17yiP2YY65N9YlkU8Mz0l 7lmNkJePBSEOt/B3NwmaDeGn359zabAGQsbliK/cxKYPPDVZVq2R+R3gs4QCfv3V R+FVpNWxx3446fuk86sD =CaWQ -----END PGP SIGNATURE----- --J58k4iUnqtw3lv0j--