pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrei Lepikhov <lepihov@gmail.com>
To: Sami Imseih <samimseih@gmail.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
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, 19 Mar 2025 21:37:23 +0100
Message-ID: <2c9376aa-9c66-4662-9803-3d9bc2afead1@gmail.com> (raw)
In-Reply-To: <CAA5RZ0vOcJF91O2e5AQN+V6guMNLMhJx83dxALf-iUZ-hLGO_Q@mail.gmail.com>
References: <CA+TgmoYSzg58hPuBmei46o8D3SKX+SZoO4K_aGQGwiRzvRApLg@mail.gmail.com>
	<CAA5RZ0uAPhbU9ZjG5JNDSfEE+2Kx+oAwGBdPLHhCU8H8kHG73A@mail.gmail.com>
	<2234935.1741809008@sss.pgh.pa.us>
	<CAA5RZ0vPvERsw1SJPohLm-sunLqndwEoP4VMD4NeZ1D0VVNB3w@mail.gmail.com>
	<CAA5RZ0uky7T78K4+-+3jMLrtfF2Oh7_Km6-XEoCc6E4M4Bpe6Q@mail.gmail.com>
	<CA+TgmoY06y2BqCYwfcn3=jXTRkio5CD+9fjbVbsJgUDN1PkRHA@mail.gmail.com>
	<CAA5RZ0tM8jEe_LSjjrTux9TbTpLex-PFQtSuVcfXCWT=N+thug@mail.gmail.com>
	<CA+Tgmoa+Yk8Pf80C1NgCu+ektyT=VZ_Wr+ZdZ0eTAC1RwKrp9w@mail.gmail.com>
	<CAA5RZ0v5pcWSxvuBrDfr2LeTw+0CkhoRc3SktPBHkEqh8Uhzcw@mail.gmail.com>
	<CAA5RZ0twuFUnP2U5w-XOtdqmWRi3VaB261x8jDxVs2YGaUUCUA@mail.gmail.com>
	<CA+TgmoZU1_arvV_gq1MfgQnW1LvK4m67Cp_O3jGMYM971gm45A@mail.gmail.com>
	<CAA5RZ0s=NYuB1SnuGmCbeC1=a0adQLmwSw3V-7E33u2R1=9JaA@mail.gmail.com>
	<CA+TgmoZt0-i=d07gHAVZ1Va_0eqCLSRTY+7KXzzWoXua9T1Kkw@mail.gmail.com>
	<CAA5RZ0vOcJF91O2e5AQN+V6guMNLMhJx83dxALf-iUZ-hLGO_Q@mail.gmail.com>

On 19/3/2025 18:41, Sami Imseih wrote:
>> On Wed, Mar 19, 2025 at 11:38 AM Sami Imseih <samimseih@gmail.com> wrote:
>>> ... as I made the hook signature match that of
>>> ParseExplainOptionList, so both pstate and the options list
>>> are now available to the hook.
>>
>> This version LGTM, except it's not pgindent-clean.
> 
> ugh, sorry about that. ran it for both modified files and it found one
> indentation correction from v2.
> 
>> index 1d4be3c18ac..8fe1ca5c73e 100644
> 38c38
> < +        (*explain_validate_options_hook) (es, options, pstate);
> ---
>> +        (*explain_validate_options_hook)(es, options, pstate);
> 59c59
> < 2.47.1
> 
> v3 attached.
I want to criticize this patch a bit. ;) Why do you think this hook is 
not redundant? May we avoid it at all? It seems to perform a too-narrow 
task.
For example, if you want to separate parameters that may be used on a 
plain EXPLAIN and on EXPLAIN ANALYZE to get behaviour like the following:

EXPLAIN (BUFFERS ON, TIMING ON) SELECT * FROM pg_class;
ERROR: EXPLAIN option TIMING requires ANALYZE

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.

 > ERROR:  EXPLAIN options REMOTE_PLANS and ANALYZE cannot be used
 > together
I think the additional parameter covers the case you provided, isn't it?

-- 
regards, Andrei Lepikhov





view thread (88+ messages)  latest in thread

Message-ID: <2c9376aa-9c66-4662-9803-3d9bc2afead1@gmail.com>
Permalink:  ../2c9376aa-9c66-4662-9803-3d9bc2afead1@gmail.com/
Also on:    postgresql.org/message-id/2c9376aa-9c66-4662-9803-3d9bc2afead1@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, samimseih@gmail.com, robertmhaas@gmail.com, tgl@sss.pgh.pa.us, pgsql@j-davis.com, thom@linux.com
  Subject: Re: making EXPLAIN extensible
  In-Reply-To: <2c9376aa-9c66-4662-9803-3d9bc2afead1@gmail.com>
  References: <CA+TgmoYSzg58hPuBmei46o8D3SKX+SZoO4K_aGQGwiRzvRApLg@mail.gmail.com> <CAA5RZ0uAPhbU9ZjG5JNDSfEE+2Kx+oAwGBdPLHhCU8H8kHG73A@mail.gmail.com> <2234935.1741809008@sss.pgh.pa.us> <CAA5RZ0vPvERsw1SJPohLm-sunLqndwEoP4VMD4NeZ1D0VVNB3w@mail.gmail.com> <CAA5RZ0uky7T78K4+-+3jMLrtfF2Oh7_Km6-XEoCc6E4M4Bpe6Q@mail.gmail.com> <CA+TgmoY06y2BqCYwfcn3=jXTRkio5CD+9fjbVbsJgUDN1PkRHA@mail.gmail.com> <CAA5RZ0tM8jEe_LSjjrTux9TbTpLex-PFQtSuVcfXCWT=N+thug@mail.gmail.com> <CA+Tgmoa+Yk8Pf80C1NgCu+ektyT=VZ_Wr+ZdZ0eTAC1RwKrp9w@mail.gmail.com> <CAA5RZ0v5pcWSxvuBrDfr2LeTw+0CkhoRc3SktPBHkEqh8Uhzcw@mail.gmail.com> <CAA5RZ0twuFUnP2U5w-XOtdqmWRi3VaB261x8jDxVs2YGaUUCUA@mail.gmail.com> <CA+TgmoZU1_arvV_gq1MfgQnW1LvK4m67Cp_O3jGMYM971gm45A@mail.gmail.com> <CAA5RZ0s=NYuB1SnuGmCbeC1=a0adQLmwSw3V-7E33u2R1=9JaA@mail.gmail.com> <CA+TgmoZt0-i=d07gHAVZ1Va_0eqCLSRTY+7KXzzWoXua9T1Kkw@mail.gmail.com> <CAA5RZ0vOcJF91O2e5AQN+V6guMNLMhJx83dxALf-iUZ-hLGO_Q@mail.gmail.com> <2c9376aa-9c66-4662-9803-3d9bc2afead1@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