Re: making EXPLAIN extensible

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sami Imseih <samimseih(at)gmail(dot)com>
Cc: Andrei Lepikhov <lepihov(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jeff Davis <pgsql(at)j-davis(dot)com>, Thom Brown <thom(at)linux(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: making EXPLAIN extensible
Date: 2025-03-19 21:10:32
Message-ID: 815319.1742418632@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Sami Imseih <samimseih(at)gmail(dot)com> writes:
>> It would be better to add the parameter "type: EXPLAIN_ONLY |
>> ANALYZE_ONLY | BOTH" to the RegisterExtensionExplainOption() routine.
>> This value will be saved inside the ExplainExtensionOption structure and
>> processed by the core inside the ParseExplainOptionList.

> hmm, IIUC, what you are describing is flag that will be limited to
> only check if an option can be used with EXPLAIN_ONLY, ANALYZE_ONLY
> or both. But what about if I have a case to check against between other
> extension options? let's say ExtensionAOptionA and ExtensionAoptionB.
> How would that work with the way you are suggesting?

More generally, I think that's quite a constricted view of what sorts
of checks an extension might need to make. As an example, suppose
an extension's option conflicts with "GENERIC_PLAN on" for some reason
(perhaps it wants to modify the plan).

I think the current hook proposal is fine. It leaves all the
validation work to be done by the extension(s), sure, but the amount
of code required to handle that one case is tiny, and the door is
left open to handle cases we didn't foresee.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2025-03-19 21:13:17 Doc: Fixup misplaced filelist.sgml entities and add some commentary
Previous Message Peter Geoghegan 2025-03-19 21:08:38 Re: Adding skip scan (including MDAM style range skip scan) to nbtree