pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Langote <amitlan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Revert "Don't lock partitions pruned by initial pruning"
Date: Thu, 22 May 2025 08:04:24 +0000
Message-ID: <E1uI0ue-000E4M-1c@gemulon.postgresql.org> (raw)

Revert "Don't lock partitions pruned by initial pruning"

As pointed out by Tom Lane, the patch introduced fragile and invasive
design around plan invalidation handling when locking of prunable
partitions was deferred from plancache.c to the executor. In
particular, it violated assumptions about CachedPlan immutability and
altered executor APIs in ways that are difficult to justify given the
added complexity and overhead.

This also removes the firstResultRels field added to PlannedStmt in
commit 28317de72, which was intended to support deferred locking of
certain ModifyTable result relations.

Reported-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/605328.1747710381@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1722d5eb05d8e5d2e064cd1798abcae4f296ca9d

Modified Files
--------------
contrib/auto_explain/auto_explain.c             |  16 +-
contrib/pg_stat_statements/pg_stat_statements.c |  16 +-
doc/src/sgml/release-18.sgml                    |  21 ---
src/backend/commands/copyto.c                   |   5 +-
src/backend/commands/createas.c                 |   5 +-
src/backend/commands/explain.c                  |  22 +--
src/backend/commands/extension.c                |   4 +-
src/backend/commands/matview.c                  |   5 +-
src/backend/commands/portalcmds.c               |   1 -
src/backend/commands/prepare.c                  |   9 +-
src/backend/commands/trigger.c                  |  15 --
src/backend/executor/README                     |  35 +----
src/backend/executor/execMain.c                 | 127 ++-------------
src/backend/executor/execParallel.c             |  12 +-
src/backend/executor/execPartition.c            |  66 +-------
src/backend/executor/execUtils.c                |   1 -
src/backend/executor/functions.c                |   5 +-
src/backend/executor/spi.c                      |  29 +---
src/backend/optimizer/plan/planner.c            |   2 -
src/backend/optimizer/plan/setrefs.c            |   3 -
src/backend/tcop/postgres.c                     |   4 +-
src/backend/tcop/pquery.c                       |  51 +-----
src/backend/utils/cache/plancache.c             | 197 +++---------------------
src/backend/utils/mmgr/portalmem.c              |   4 +-
src/include/commands/explain.h                  |   6 +-
src/include/commands/trigger.h                  |   1 -
src/include/executor/execdesc.h                 |   2 -
src/include/executor/executor.h                 |  34 +---
src/include/nodes/execnodes.h                   |   3 -
src/include/nodes/pathnodes.h                   |   3 -
src/include/nodes/plannodes.h                   |   7 -
src/include/utils/plancache.h                   |  46 +-----
src/include/utils/portal.h                      |   4 +-
33 files changed, 89 insertions(+), 672 deletions(-)



Message-ID: <E1uI0ue-000E4M-1c@gemulon.postgresql.org>
Permalink:  ../E1uI0ue-000E4M-1c@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1uI0ue-000E4M-1c@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: amitlan@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Revert "Don't lock partitions pruned by initial pruning"
  In-Reply-To: <E1uI0ue-000E4M-1c@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