pgsql: pg_overexplain: Additional EXPLAIN options for debugging.

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: pg_overexplain: Additional EXPLAIN options for debugging.
Date: 2025-03-26 18:01:38
Message-ID: E1txV4M-00185V-2Q@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

pg_overexplain: Additional EXPLAIN options for debugging.

There's a fair amount of information in the Plan and PlanState trees
that isn't printed by any existing EXPLAIN option. This means that,
when working on the planner, it's often necessary to rely on facilities
such as debug_print_plan, which produce excessively voluminous
output. Hence, use the new EXPLAIN extension facilities to implement
EXPLAIN (DEBUG) and EXPLAIN (RANGE_TABLE) as extensions to the core
EXPLAIN facility.

A great deal more could be done here, and the specific choices about
what to print and how are definitely arguable, but this is at least
a starting point for discussion and a jumping-off point for possible
future improvements.

Reviewed-by: Sami Imseih <samimseih(at)gmail(dot)com>
Reviewed-by: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Reviweed-by: Andrei Lepikhov <lepihov(at)gmail(dot)com> (who didn't like it)
Discussion: http://postgr.es/m/CA+TgmoZfvQUBWQ2P8iO30jywhfEAKyNzMZSR+uc2xr9PZBw6eQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8d5ceb113e3f7ddb627bd40b26438a9d2fa05512

Modified Files
--------------
contrib/Makefile | 1 +
contrib/meson.build | 1 +
contrib/pg_overexplain/.gitignore | 4 +
contrib/pg_overexplain/Makefile | 21 +
contrib/pg_overexplain/expected/pg_overexplain.out | 483 +++++++++++++
contrib/pg_overexplain/meson.build | 28 +
contrib/pg_overexplain/pg_overexplain.c | 763 +++++++++++++++++++++
contrib/pg_overexplain/sql/pg_overexplain.sql | 105 +++
doc/src/sgml/contrib.sgml | 1 +
doc/src/sgml/filelist.sgml | 1 +
doc/src/sgml/pgoverexplain.sgml | 186 +++++
src/tools/pgindent/typedefs.list | 1 +
12 files changed, 1595 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2025-03-26 18:24:28 pgsql: Fix oversights in commit 8d5ceb113e3f7ddb627bd40b26438a9d2fa0551
Previous Message Tomas Vondra 2025-03-26 16:06:39 pgsql: Keep the decompressed filter in brin_bloom_union