pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Invent GENERIC_PLAN option for EXPLAIN.
Date: Fri, 24 Mar 2023 21:07:35 +0000
Message-ID: <E1pfodK-005DD1-Lc@gemulon.postgresql.org> (raw)

Invent GENERIC_PLAN option for EXPLAIN.

This provides a very simple way to see the generic plan for a
parameterized query.  Without this, it's necessary to define
a prepared statement and temporarily change plan_cache_mode,
which is a bit tedious.

One thing that's a bit of a hack perhaps is that we disable
execution-time partition pruning when the GENERIC_PLAN option
is given.  That's because the pruning code may attempt to
fetch the value of one of the parameters, which would fail.

Laurenz Albe, reviewed by Julien Rouhaud, Christoph Berg,
Michel Pelletier, Jim Jones, and myself

Discussion: https://postgr.es/m/0a29b954b10b57f0d135fe12aa0909bd41883eb0.camel@cybertec.at

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3c05284d83b230728e59a25e828992037ef77096

Modified Files
--------------
doc/src/sgml/ref/explain.sgml         | 70 +++++++++++++++++++++++++++++++----
src/backend/commands/explain.c        | 11 ++++++
src/backend/executor/execMain.c       |  2 +-
src/backend/executor/execPartition.c  | 10 +++--
src/backend/parser/analyze.c          | 29 +++++++++++++++
src/bin/psql/tab-complete.c           |  4 +-
src/include/commands/explain.h        |  1 +
src/include/executor/executor.h       | 22 ++++++++---
src/test/regress/expected/explain.out | 42 +++++++++++++++++++++
src/test/regress/sql/explain.sql      | 26 +++++++++++++
10 files changed, 197 insertions(+), 20 deletions(-)



Message-ID: <E1pfodK-005DD1-Lc@gemulon.postgresql.org>
Permalink:  ../E1pfodK-005DD1-Lc@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1pfodK-005DD1-Lc@gemulon.postgresql.org

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Invent GENERIC_PLAN option for EXPLAIN.
  In-Reply-To: <E1pfodK-005DD1-Lc@gemulon.postgresql.org>

* 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