pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrei Lepikhov <lepihov@gmail.com>
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>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Subject: Re: making EXPLAIN extensible
Date: Tue, 18 Mar 2025 13:02:08 +0100
Message-ID: <760b4c92-6790-40e1-8a2b-631744a51433@gmail.com> (raw)
In-Reply-To: <CA+TgmoZRLm_tVWxv26Ho93aHkZ5NY8Hz-ffq0fykY6KdTSjSZg@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>

On 3/7/25 16:05, Robert Haas wrote:
I have attempted to use hooks, proposed in 0002, in my extensions.
At first, it worked great. My patch reduced a lot, and the only things 
that I need in the planner to improve its predictions are the 
selectivity hook and the create_plan hook - the last one needed to pass 
data from the best_path chosen to the plan and needed to compare 
prediction and reality at the end of execution.

Some questions:
1. I think, hooks ExplainOneQuery_hook_type, explain_per_plan_hook_type, 
explain_per_node_hook_type deserve to be moved to explain_format.h
At least, inside the hook, we usually use functions like ExplainProperty.
2. In my patch I inserted the hook before the line 1894:
/* in text format, the first line ends here */
Why have you chosen a different way? I don't have specific reasons to 
insist, except the extension data right under the node looks better to 
me personally.

Some changes of the explain format have already been made in the current 
master. Applying this proposal now would reduce additional work for 
extension (and fork) maintainers in the next version.

-- 
regards, Andrei Lepikhov





view thread (88+ messages)  latest in thread

Message-ID: <760b4c92-6790-40e1-8a2b-631744a51433@gmail.com>
Permalink:  ../760b4c92-6790-40e1-8a2b-631744a51433@gmail.com/
Also on:    postgresql.org/message-id/760b4c92-6790-40e1-8a2b-631744a51433@gmail.com

 · 

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: lepihov@gmail.com, robertmhaas@gmail.com, pgsql@j-davis.com, thom@linux.com, tgl@sss.pgh.pa.us
  Subject: Re: making EXPLAIN extensible
  In-Reply-To: <760b4c92-6790-40e1-8a2b-631744a51433@gmail.com>
  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> <760b4c92-6790-40e1-8a2b-631744a51433@gmail.com>

* 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