Re: making EXPLAIN extensible

From: Sami Imseih <samimseih(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Andrei Lepikhov <lepihov(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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-21 00:37:26
Message-ID: CAA5RZ0sKhLRqce2+tvfuzBzm=HWQCe5TdPcbj7Vse+jQE=pyVA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> It sounds like we're sufficiently in agreement so I've committed the
> patch.

Thanks!

> I've rebased my pg_overexplain patch and attach that here.

I spent some time playing around with this extension, and I can
see the value.

1/ provides a good example for future extensions on how to
use the new hooks. it definitely would be nice to add an example
for the hook added to check options against each other as mentioned
by Andrei here [0] but I could not find a good reason to do so with
pg_overexplain.

2/ I agree that this is better than debug_print_plan to avoid all the
verbosity of that output emitting at once. But maybe it will be useful
to provide options to show other parts like the target list, quals, etc.
I wonder if something like this will be better?

explain (query_tree_show range_table) select ..
explain (query_tree_show qualification) select ..
explain (query_tree_show target_list) select ..

The user can choose which information they want to see by passing
a value to an option called query_tree_show ( or a better option name)

Initially, we can only support range_table, but future enhancements
could include other parts.

Maybe a good idea, maybe not, what do you think?

Besides that, I found a few minor things:

1/ trailing whitespace

+ <literal>Subplans Needing Rewind</literal>. Integer IDs of subplans that

2/ typos
* We don't try to print everything here. Information that would be displyed

* to limit the display length by # of columsn or # of characters, but for

[0] https://www.postgresql.org/message-id/8e8b6f17-e1e6-4b16-84d4-37ded802c787%40gmail.com

--

Sami Imseih
Amazon Web Services (AWS)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2025-03-21 00:41:09 Re: Remove redundant if-else in EXPLAIN by using ExplainPropertyText
Previous Message Jacob Champion 2025-03-21 00:02:36 Re: dblink: Add SCRAM pass-through authentication