model-writtenrun 6150 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Rajkumar Raghuwanshi reported an EXISTS query over list partitions that failed with an uninitialized subplan error and supplied a reproducer #1; Ranier Vilela reproduced the failure on Windows and supplied a backtrace #2.
- Tom Lane diagnosed that copies of the same AlternativeSubPlan could select different alternatives for different partitions, causing immediate deletion to remove subplans still needed elsewhere; he proposed deferring deletion until all alternatives had been examined to preserve executor startup savings #3.
- Tom Lane implemented that design in e8638d78a2, using per-query tracking arrays and deferred cleanup, adding a partitioned EXISTS regression test, and backpatching the fix to PostgreSQL 14.
- After the commit, Zhihong Yu questioned whether tracking the selected subplan could replace the boolean array #4; Tom Lane explained that the array combines selections from potentially many AlternativeSubPlans #5.
- Ranier Vilela submitted a smaller alternative and reported passing tests #6, but Tom Lane explained that its second loop had no external effect and retained unused subplans, whereas the committed fix preserved the intended startup savings #7.
- Ranier Vilela then proposed an inline revision that cleared entries in the AlternativeSubPlan's own list #9; Tom Lane explained that this node disappears from the finished tree and that effective cleanup must instead modify the global subplans list using information from all alternatives #10.
- Ranier Vilela tried operating directly on the global list #11, then withdrew that attempt after encountering an unrecognized-node-type error #12; the thread ended with Tom Lane's fix committed and no successful replacement.