pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Allow private state in certain planner data structures.
Date: Tue, 07 Oct 2025 16:21:22 +0000
Message-ID: <E1v6ARG-000XDO-1H@gemulon.postgresql.org> (raw)

Allow private state in certain planner data structures.

Extension that make extensive use of planner hooks may want to
coordinate their efforts, for example to avoid duplicate computation,
but that's currently difficult because there's no really good way to
pass data between different hooks.

To make that easier, allow for storage of extension-managed private
state in PlannerGlobal, PlannerInfo, and RelOptInfo, along very
similar lines to what we have permitted for ExplainState since commit
c65bc2e1d14a2d4daed7c1921ac518f2c5ac3d17.

Reviewed-by: Andrei Lepikhov <lepihov@gmail.com>
Reviewed-by: Melanie Plageman <melanieplageman@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: http://postgr.es/m/CA+TgmoYWKHU2hKr62Toyzh-kTDEnMDeLw7gkOOnjL-TnOUq0kQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0132dddab33a6eae2d3d63eda9f053e745fedb06

Modified Files
--------------
src/backend/optimizer/util/Makefile     |   1 +
src/backend/optimizer/util/extendplan.c | 183 ++++++++++++++++++++++++++++++++
src/backend/optimizer/util/meson.build  |   1 +
src/include/nodes/pathnodes.h           |  12 +++
src/include/optimizer/extendplan.h      |  72 +++++++++++++
5 files changed, 269 insertions(+)



Message-ID: <E1v6ARG-000XDO-1H@gemulon.postgresql.org>
Permalink:  ../E1v6ARG-000XDO-1H@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1v6ARG-000XDO-1H@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: rhaas@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Allow private state in certain planner data structures.
  In-Reply-To: <E1v6ARG-000XDO-1H@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