pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Jeff Davis <pgsql@j-davis.com>
Cc: Thom Brown <thom@linux.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: making EXPLAIN extensible
Date: Thu, 06 Mar 2025 16:16:27 -0500
Message-ID: <899469.1741295787@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmobK2+GwWwqpV-EAAdn5q14xphOm+JrE+mfOO8XqyN4HGQ@mail.gmail.com>
References: <CA+TgmoYSzg58hPuBmei46o8D3SKX+SZoO4K_aGQGwiRzvRApLg@mail.gmail.com>
	<CAA-aLv4MDS2aQLR9v5xgg9qiN7z_YrbcYf-FGWVCN=Jv_Psppg@mail.gmail.com>
	<CA+TgmoYf6JtCdYJ0Q4WgC-B9t07JTAH9MEMxX4_riuXvjM8ETQ@mail.gmail.com>
	<5bbca514250c1f8ee45f08ada94184b0ae109fe9.camel@j-davis.com>
	<CA+TgmoaE=7QGjWoWoi19gdF90YO1a0tq1-iyWVAhj82BMPnJSg@mail.gmail.com>
	<82f96eed213c8d76b36b8a3f504576e5af493270.camel@j-davis.com>
	<CA+TgmobPz9phD5PpXeUNTSrkc9uXkRg6Gfq6gPatpA-XTaQCcw@mail.gmail.com>
	<339167.1741200807@sss.pgh.pa.us>
	<CA+TgmobpP-7yOT-vdOFKFZoxe_z_36tgzorGyuF8wtZvZRtV8Q@mail.gmail.com>
	<476382.1741208421@sss.pgh.pa.us>
	<CA+TgmoZR-j1nqc9uz-9SMb2BecM-_bz4btixJ2X=9JCaCuEWEQ@mail.gmail.com>
	<480078.1741210736@sss.pgh.pa.us>
	<CA+TgmobK2+GwWwqpV-EAAdn5q14xphOm+JrE+mfOO8XqyN4HGQ@mail.gmail.com>

Robert Haas <robertmhaas@gmail.com> 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





view thread (88+ messages)  latest in thread

Message-ID: <899469.1741295787@sss.pgh.pa.us>
Permalink:  ../899469.1741295787@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/899469.1741295787@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, pgsql@j-davis.com, thom@linux.com
  Subject: Re: making EXPLAIN extensible
  In-Reply-To: <899469.1741295787@sss.pgh.pa.us>
  References: <CA+TgmoYSzg58hPuBmei46o8D3SKX+SZoO4K_aGQGwiRzvRApLg@mail.gmail.com> <CAA-aLv4MDS2aQLR9v5xgg9qiN7z_YrbcYf-FGWVCN=Jv_Psppg@mail.gmail.com> <CA+TgmoYf6JtCdYJ0Q4WgC-B9t07JTAH9MEMxX4_riuXvjM8ETQ@mail.gmail.com> <5bbca514250c1f8ee45f08ada94184b0ae109fe9.camel@j-davis.com> <CA+TgmoaE=7QGjWoWoi19gdF90YO1a0tq1-iyWVAhj82BMPnJSg@mail.gmail.com> <82f96eed213c8d76b36b8a3f504576e5af493270.camel@j-davis.com> <CA+TgmobPz9phD5PpXeUNTSrkc9uXkRg6Gfq6gPatpA-XTaQCcw@mail.gmail.com> <339167.1741200807@sss.pgh.pa.us> <CA+TgmobpP-7yOT-vdOFKFZoxe_z_36tgzorGyuF8wtZvZRtV8Q@mail.gmail.com> <476382.1741208421@sss.pgh.pa.us> <CA+TgmoZR-j1nqc9uz-9SMb2BecM-_bz4btixJ2X=9JCaCuEWEQ@mail.gmail.com> <480078.1741210736@sss.pgh.pa.us> <CA+TgmobK2+GwWwqpV-EAAdn5q14xphOm+JrE+mfOO8XqyN4HGQ@mail.gmail.com> <899469.1741295787@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox