| From: | "Matheus Alcantara" <matheusssilv97(at)gmail(dot)com> |
|---|---|
| To: | "Robert Haas" <robertmhaas(at)gmail(dot)com> |
| Cc: | <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "Lukas Fittl" <lukas(at)fittl(dot)com>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
| Subject: | Re: Add custom EXPLAIN options support to auto_explain |
| Date: | 2026-03-31 22:10:08 |
| Message-ID: | DHHB7U2PSFYG.1A0WVPTX5LNOD@gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Tue Mar 31, 2026 at 1:18 PM -03, Robert Haas wrote:
> On Mon, Mar 30, 2026 at 5:49 PM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>> I'm currently poking at some ideas for fixing this... more soon.
>
> Here are some patches. I got started poking at this in earnest
> because, on the pg_plan_advice thread, Lukas was saying that instead
> of adopting pg_collect_advice, we should just add an option to send
> advice strings for each executed query to the server log. I went to
> implement that and then felt like it should really be part of
> auto_explain rather than its own thing, which took me down a bit of a
> rathole. But I eventually found my way back out of it, so here's a
> patch set implementing auto_explain.log_extension_options.
>
> ...
>
> So I ended up with this:
>
> ...
>
> Thoughts?
Hi, thanks for the patches. I think that the architecture is much better
now.
For 0001 I don't have any comment, it looks good to me. The 0002 also
looks good, just a typo on "thent" on commit message. Some comments on
0003:
+ else if (opt->type == T_Integer)
+ arg = (Node *) makeInteger(strtol(opt->value, NULL, 0));
I think that we are safe against overflow because on
auto_explain_split_options() it has intval == (int) intval, but I'm
wondering if it's worth documenting this?
-----
extension_options is being added to REGRESS in both Makefile and
meson.build, but the actual test files are not included.
-----
+ an associated value. The module that provides the
+ <literal>EXPLAIN</literal> option, such as
+ <link linkend="pgplanadvice"><literal>pg_plan_advice</literal></link> or
+ <link linkend="pgoverexplain"><literal>pg_overexplain</literal></link>,
+ should be loaded before this parameter is set.
Wondering if this is clear enough about the shared_preload_libraries
order (auto_explain should be loaded after extensions that include
explain options) or if we should mention this explicitly.
--
Matheus Alcantara
EDB: https://www.enterprisedb.com
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Mihail Nikalayeu | 2026-03-31 22:11:40 | Re: Revisiting {CREATE INDEX, REINDEX} CONCURRENTLY improvements |
| Previous Message | Andres Freund | 2026-03-31 22:05:46 | Re: Buffer locking is special (hints, checksums, AIO writes) |