pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Sami Imseih <samimseih@gmail.com>
Cc: 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: Wed, 12 Mar 2025 15:50:08 -0400
Message-ID: <2234935.1741809008@sss.pgh.pa.us> (raw)
In-Reply-To: <CAA5RZ0uAPhbU9ZjG5JNDSfEE+2Kx+oAwGBdPLHhCU8H8kHG73A@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>
	<899469.1741295787@sss.pgh.pa.us>
	<CA+TgmoaF3fNJ_ZtAcJcjtoqX1djvvsm2hkSCR6y45NDC_vSaTw@mail.gmail.com>
	<CA+TgmoZRLm_tVWxv26Ho93aHkZ5NY8Hz-ffq0fykY6KdTSjSZg@mail.gmail.com>
	<1056391.1741368807@sss.pgh.p! a.us>
	<CAA5RZ0uAPhbU9ZjG5JNDSfEE+2Kx+oAwGBdPLHhCU8H8kHG73A@mail.gmail.com>

Sami Imseih <samimseih@gmail.com> writes:
> 1/ As you can see form the output above, I used explain_per_node_hook
> to append a "Plan Node ID" to the explain output. I really don't like having it
> there, and prefer that it gets added to the top line of the node.

> i.e.
>    ->  Foreign Scan on t_r1  (cost=100.00..673.20 rows=2560 width=8) (node_id=1)
>    ->  Materialize  (cost=100.00..686.00 rows=2560 width=8) (node_id=2)
>          ->  Foreign Scan on t1_r1  (cost=100.00..673.20 rows=2560
> width=8) (node_id=3)

> Can we add a hook at that point [1] which will allow an extension to modify
> the first line of a node? I think this is not just useful for my case, but also
> for other use-cases in which some high level node details could be placed.
> what do you think?

I think this is a seriously bad idea.  The first line is already
overloaded; we don't need several different extensions adding more
stuff to it.  Plus, this doesn't consider what to do in non-text
output formats.  ISTM you should be good with adding a new
"Plan Node ID" property to each node.  No, you don't get to put it
first.  Too bad.  (If we did try to cater to that, what shall we do
with multiple extensions that all think they should be first?)

The validation point is an interesting one.  I agree that we don't
want the behavior to depend on the order in which options are
written.

			regards, tom lane





view thread (88+ messages)  latest in thread

Message-ID: <2234935.1741809008@sss.pgh.pa.us>
Permalink:  ../2234935.1741809008@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2234935.1741809008@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, samimseih@gmail.com, robertmhaas@gmail.com, pgsql@j-davis.com, thom@linux.com
  Subject: Re: making EXPLAIN extensible
  In-Reply-To: <2234935.1741809008@sss.pgh.pa.us>
  References: <CA+TgmoYSzg58hPuBmei46o8D3SKX+SZoO4K_aGQGwiRzvRApLg@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> <CA+TgmoaF3fNJ_ZtAcJcjtoqX1djvvsm2hkSCR6y45NDC_vSaTw@mail.gmail.com> <CA+TgmoZRLm_tVWxv26Ho93aHkZ5NY8Hz-ffq0fykY6KdTSjSZg@mail.gmail.com> <CAA5RZ0uAPhbU9ZjG5JNDSfEE+2Kx+oAwGBdPLHhCU8H8kHG73A@mail.gmail.com> <2234935.1741809008@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