public inbox for [email protected]  
help / color / mirror / Atom feed
From: Robert Haas <[email protected]>
To: [email protected]
Subject: pgsql: Make it possible for loadable modules to add EXPLAIN options.
Date: Tue, 18 Mar 2025 12:56:08 +0000
Message-ID: <[email protected]> (raw)

Make it possible for loadable modules to add EXPLAIN options.

Modules can use RegisterExtensionExplainOption to register new
EXPLAIN options, and GetExplainExtensionId, GetExplainExtensionState,
and SetExplainExtensionState to store related state inside the
ExplainState object.

Since this substantially increases the amount of code that needs
to handle ExplainState-related tasks, move a few bits of existing
code to a new file explain_state.c and add the rest of this
infrastructure there.

See the comments at the top of explain_state.c for further
explanation of how this mechanism works.

This does not yet provide a way for such such options to do anything
useful. The intention is that we'll add hooks for that purpose in a
separate commit.

Discussion: http://postgr.es/m/CA+TgmoYSzg58hPuBmei46o8D3SKX+SZoO4K_aGQGwiRzvRApLg@mail.gmail.com
Reviewed-by: Srinath Reddy <[email protected]>
Reviewed-by: Andrei Lepikhov <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Reviewed-by: Sami Imseih <[email protected]>

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c65bc2e1d14a2d4daed7c1921ac518f2c5ac3d17

Modified Files
--------------
contrib/auto_explain/auto_explain.c   |   1 +
contrib/file_fdw/file_fdw.c           |   3 +-
contrib/postgres_fdw/postgres_fdw.c   |   2 +-
src/backend/commands/Makefile         |   1 +
src/backend/commands/createas.c       |   2 +
src/backend/commands/explain.c        | 143 +------------
src/backend/commands/explain_dr.c     |   1 +
src/backend/commands/explain_format.c |   1 +
src/backend/commands/explain_state.c  | 371 ++++++++++++++++++++++++++++++++++
src/backend/commands/meson.build      |   1 +
src/backend/commands/prepare.c        |   2 +
src/backend/executor/execAmi.c        |   1 +
src/backend/tcop/pquery.c             |   1 +
src/include/commands/explain.h        |  80 ++------
src/include/commands/explain_state.h  |  95 +++++++++
src/include/commands/prepare.h        |   3 +-
src/include/nodes/extensible.h        |   2 +-
src/tools/pgindent/typedefs.list      |   2 +
18 files changed, 503 insertions(+), 209 deletions(-)



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: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: pgsql: Make it possible for loadable modules to add EXPLAIN options.
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox