1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

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
This commit is contained in:
Amit Langote
2025-05-22 14:17:24 +09:00
parent f3622b6476
commit 1722d5eb05
33 changed files with 90 additions and 673 deletions

View File

@ -588,27 +588,6 @@ Improve the locking performance of queries that access many relations (Tomas Von
</para>
</listitem>
<!--
Author: Amit Langote <amitlan@postgresql.org>
2025-01-30 [bb3ec16e1] Move PartitionPruneInfo out of plan nodes into PlannedSt
Author: Amit Langote <amitlan@postgresql.org>
2025-01-31 [d47cbf474] Perform runtime initial pruning outside ExecInitNode()
Author: Amit Langote <amitlan@postgresql.org>
2025-02-07 [cbc127917] Track unpruned relids to avoid processing pruned relatio
Author: Amit Langote <amitlan@postgresql.org>
2025-02-20 [525392d57] Don't lock partitions pruned by initial pruning
-->
<listitem>
<para>
Avoid the locking of pruned partitions during execution (Amit Langote)
<ulink url="&commit_baseurl;bb3ec16e1">&sect;</ulink>
<ulink url="&commit_baseurl;d47cbf474">&sect;</ulink>
<ulink url="&commit_baseurl;cbc127917">&sect;</ulink>
<ulink url="&commit_baseurl;525392d57">&sect;</ulink>
</para>
</listitem>
<!--
Author: David Rowley <drowley@postgresql.org>
2024-08-20 [adf97c156] Speed up Hash Join by making ExprStates support hashing