model-writtenrun 6857 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Dec 2021 - Apr 2022 · 8 entries
- Amit Langote opened the thread with #1, proposing initial partition pruning during generic-plan validation to avoid locking thousands of partitions that execution would discard, initially repeating pruning during executor startup.
- Amul Sul reviewed pruning-state ownership and duplicated code in #4, while Robert Haas emphasized in #5 and #7 that execution must reuse the same pruning decisions because unlocked plan branches can become invalid.
- Amit introduced ExecutorPrep() and stored per-node preparation results in #17; Robert requested isolated cleanup and a generic walker in #18, while Andres Freund questioned overhead on unaffected queries in #19.
- The implementation narrowed to ExecutorGetLockRels() and three separate components in #24; Tom Lane challenged safety, documentation, and generic-plan costing in #28, and Robert argued that locking improvements remained worthwhile independently of costing in #29.
- Missing ancestor locks led to additional partition metadata in #32, but David Rowley's reviews in #37 and #40 proposed collecting pruning descriptors directly in PlannedStmt instead of walking the plan again.
- Alvaro Herrera's cleanup review produced the standalone patch #47, which landed as 297daa9d43 with naming, commentary, and equivalent condition-order edits explained in #48.
- Amit adopted the compact descriptor-list design in #50, discarding the walker and ancestor-tracking prerequisites; David then rejected mutable pruning results inside CachedPlan in #52, leading to caller-owned results in #53.
- David supplied concrete fixups in #54, incorporated into #55, but the release freeze left the main optimization uncommitted.
May - Jul 2022 · 1 entry
- The series split descriptor relocation from locking in #58, survived summer rebases, and briefly introduced serializable Bitmapset nodes in #73 before #74 eliminated that prerequisite by representing each descriptor's pruning result separately.
Oct 2022 - Apr 2023 · 5 entries
- Alvaro requested descriptor identity checks in #77, Amit supplied #78, and the combined relocation landed as ec38694894; #80 then resent only the remaining optimization.
- Discussion of immutable plans and per-execution results led to CachedPlanExtra and a prune-lock-retry controller in #93, simplified in #94.
- Tom's review in #98 rejected the expanding plan-cache interface and proposed moving locking and stale-plan handling toward executor startup; Amit first tried a preliminary InitPlan() pass in #104, then locking during ExecInitNode() in #105.
- The executor-locking approach exposed serialization, multi-query snapshot, non-leaf locking, and partial-cleanup problems, addressed across #106, #109, and #110; Tom judged the API changes too risky for the release deadline in #114.
- The architectural change initiated in #98 made the original descriptor relocation unnecessary, but the actual revert proposal and agreement occurred in thread #47664, in #531909 and #534271, producing 5472743d9e to reverse the relocation and its fixup.
Jun - Sep 2023 · 4 entries
- Amit's June redesign in #117 collected initialized nodes for nonrecursive cleanup, while #119 used RTE classification to identify child relations; Thom Brown subsequently reported substantial scaling benefits and supplied documentation corrections in #121.
- Robert and Tom questioned flat cleanup and parallel-shutdown ordering in #126 and #127, leading #131 back to recursive cleanup with guarded partially initialized nodes.
- Robert separated independent cleanup from invalidation machinery in #133, caught unsafe tuple-slot cleanup removal in #135, and approved the corrected component in #137; that component from #139 landed almost unchanged as d060e921ea.
- The remaining work continued through #140 and a later rebase, but Robert's extensive review in #142 and renewed lock-order debate between David and Tom in #146 and #147 left major design questions unresolved.
Aug 2024 - Feb 2025 · 11 entries
- After the long gap, Amit explained in #153 that starting every statement before executing any of them disrupted command-counter and snapshot semantics; Robert confirmed the concern in #154, and stale-plan tolerance was rejected after correctness discussion in #157 and #164.
- The redesign in #167 retained early locks for unprunable relations and localized retries around transient single-query plans; #170 fixed invalidation registration and Junwang Zhao's custom-plan flag finding from #168.
- Moving initial pruning ahead of ExecInitNode() in #171 removed the need to abandon partially initialized plan trees, while subsequent revisions filtered RowMarks, ResultRelInfos, and ModifyTable's parallel lists to exclude pruned relations.
- The retry design changed again in #179, replacing transient plans with in-place CachedPlan statement replacement; Robert supported the pruning prerequisites but questioned lazy contexts in #175, and Tomas Vondra reviewed and benchmarked the broader series in #180.
- Experiments in #190 and #192 moved pruning ahead of extension hooks, but #194 instead adopted boolean startup returns and abandoned lazy pruning-context initialization after discovering a SubPlan initialization problem.
- The first two components of #194 landed as bb3ec16e14 and d47cbf474e, with the latter additionally simplifying initialization bookkeeping and guarding expression-context reset explicitly.
- Amit split the remainder into relation tracking and locking in #195; the tracking component of #196 landed with comment refinements as cbc127917e, leaving #197 as the final locking patch.
- Alexander Lakhin's SQLsmith MERGE failure in #198 prompted #199; Junwang tested it and supplied a missing guard in #200, producing 75dfde1363 with additional all-pruned tests.
- The deferred-locking patch #197 landed as 525392d572, with a local change to reused-plan bookkeeping and explanatory edits.
- Tom reported CLOBBER_CACHE_ALWAYS failures in the new isolation suite in #203 and recommended deleting the fragile test in #206, resulting in the discussion-derived 4f1b6e5bb4.
- Alexander then reported a nested-Append failure in #209, Tender Wang diagnosed non-leaf partition misclassification in #210, and the reviewed fix #211 landed with expanded tests as cbb9086c9e.
May - Jul 2025 · 3 entries
- Tom's attempted memory-leak repair in #214 exposed a deeper failure when rule rewriting changed the CachedPlan statement count; in #217 he rejected in-place plan mutation and the executor API disruption and called for a revert.
- Amit supplied the revert in #218, which landed with release-note and header cleanup as 1722d5eb05; #220 explicitly retained the useful pruning prerequisites and their bug fixes.
- Amit explored transient replanning and hiding retries before hooks in #224, then reconsidered pruning during plan-cache validation and its permission and lifetime requirements in #225 and #226.
Nov 2025 · 2 entries
- The new series #227 revived the earlier preparation approach using the already-landed pruning infrastructure, ExecutorPrep(), separate preparation state, and optional parallel-worker reuse.
- Review led #233 to make the first prerequisite independently functional, while #234 replaced the ExecPrep wrapper with EState, reorganized lock tests, and reduced parallel-worker checks to debug builds.
Feb - Apr 2026 · 2 entries
- Amit discovered in #239 that preparing all statements before execution could prune using stale values across command-counter increments and leave later EStates with invalid lifetimes, so multi-statement plans reverted to conservative locking.
- The architectural rewrite #241 moved execution locking out of GetCachedPlan() into callers, keeping SPI and SQL-function paths conservative while targeting pruning-aware portal and EXPLAIN execution for a later release.
May - Jul 2026 · 3 entries
- Thom Brown found an intermediate prerequisite's stale QueryDesc pointer in #242, fixed by #243, and his first-result-relation questions in #244 led to stronger checks and ordering documentation in #245.
- Ilmar Yunusov's testing in #247 confirmed reduced SELECT and EXPLAIN locks but found UPDATE still locking all children; Amit confirmed in #248 that actual UPDATE and DELETE execution bypassed the new portal path.
- Ilmar diagnosed inconsistent cached-plan reference ownership in #249, Manu supplied the two-call correction in #251, and Rui Zhao combined it with a reproducing ordinary-EXECUTE regression test in #252.
Sep - Oct 2026 · 1 entry
- At the last message, #253, Manu confirmed that the regression failed without the ownership fix and passed with it after a mechanical rebase, with core, isolation, and test_plan_advice checks passing; the redesigned locking series remained uncommitted, DML coverage remained open, and Amit had proposed separating the plan-cache refactoring from subsequent pruning work in #243.