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>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Thom Brown <thom@linux.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Yurii Rashkovskii <yrashk@omnigres.com>
Subject: Re: making EXPLAIN extensible
Date: Wed, 5 Mar 2025 11:00:06 +0100
Message-ID: <8939a81a-abaf-46d2-bf1b-077fe186acbe@gmail.com> (raw)
In-Reply-To: <CA+TgmoaE=7QGjWoWoi19gdF90YO1a0tq1-iyWVAhj82BMPnJSg@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>

On 4/3/2025 22:23, Robert Haas wrote:
> On Tue, Mar 4, 2025 at 1:53 PM Jeff Davis <pgsql@j-davis.com> wrote:
>> I don't expect there to be zillions of extensions that only add new and
>> exciting explain options. Instead, it seems more likely that all
>> TableAM and CustomScan extensions will have 1-3 new explain options,
>> and that some of those might collide. For example, several may have a
>> EXPLAIN(PUSHDOWN) option that explains what work is being pushed down
>> into the TableAM/CustomScan.
>>
>> In that case it's not even clear to me that a collision is a problem.
>> Would you really only want pushdown information from extension A, and
>> be upset that it also emits pushdown information from extension B?
>> Maybe we should just allow multiple extensions to use the same option
>> name?
> ...
> Actually, I don't think custom scans or table AMs are the design
> center for this feature. Keep in mind that, for a custom scan, we
> already have ExplainCustomScan as part of CustomScanState->methods. We
> don't currently have anything similar for table AMs, and you could
> work around that with these hooks, by checking every node to see
> whether it's a scan node and if so whether it scans a relation that
> matches your table AM, but it would probably be better to have a
> method for it, similar to what we have for CustomScan, if this is
> something people want to do. It would be more efficient and require
> less code.
+1. In my experience, ExplainCustomScan has always been enough for the 
CustomScan node.
As for extensions collision - for now, it would be better to treat 
extensions as independent actors, suggesting that the developer, 
designing a software solution based on an extensions' constellation, 
will arrange their behaviour during development.
For instance,  if your library exports a function or variable, adding a 
prefix is essential to prevent overlapping functions when another 
library is loaded.
I recall that Yurii Rashkovskii is a proponent of using multiple 
extensions within a single installation. Perhaps he has insights on this 
topic?

-- 
regards, Andrei Lepikhov





view thread (88+ messages)  latest in thread

Message-ID: <8939a81a-abaf-46d2-bf1b-077fe186acbe@gmail.com>
Permalink:  ../8939a81a-abaf-46d2-bf1b-077fe186acbe@gmail.com/
Also on:    postgresql.org/message-id/8939a81a-abaf-46d2-bf1b-077fe186acbe@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, yrashk@omnigres.com
  Subject: Re: making EXPLAIN extensible
  In-Reply-To: <8939a81a-abaf-46d2-bf1b-077fe186acbe@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> <8939a81a-abaf-46d2-bf1b-077fe186acbe@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