model-writtenrun 8036 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- David Rowley opened the thread with a case where a nested Parallel Append lost run-time pruning, asking whether to improve child-Append flattening or attach pruning information below the top-level Append #1.
- Amit Langote supplied a proof of concept that rejected partial Append paths when their children could not be flattened, and identified incorrectly accumulated partitioned_rels metadata that would also need attention if nesting remained #2.
- David traced the failure to two equally costed partial Append candidates, with the nested candidate winning because it was added first, and replaced Amit's approach with a patch generating a single partial candidate #4 #6.
- Amit Langote and Tom Lane questioned the costing implications, while Robert Haas explained the distinct serial, fully partial, and mixed parallel strategies; David tested the relevant planner settings and reported unchanged plans #7 #9 #11 #13 #14.
- David revised the flattening patch to honor consider_parallel and improve naming and comments, after which Amit supplied a more precise explanation of child-path selection #15 #16.
- The flattening approach stalled when David identified a fragile assumption that could place non-partial scans under an ordinary partial Append, and Robert explained why merging the candidates could constrain future costing improvements #17 #18.
- After another report revived the issue in October, Amit proposed making pruning cope with nested Appends directly #19.
- David supplied that broader rework, noting that ordered scans can require nested MergeAppend nodes, collecting partition metadata per path, replacing IntLists with Relids, removing obsolete RelOptInfo metadata, and adding regression tests; he proposed it for master only because of its scope and his classification of it as an improvement #20.
- Amit reviewed the new metadata model and assertion and suggested comment corrections, which David incorporated along with minor cleanup before committing a929e17e5a from #20 and announcing the push #21 #22.
- The thread ended with the reworked approach committed and no further patch pending; Justin Pryzby later reported that the PostgreSQL 14 behavior appeared to eliminate redundant WHERE clauses in his workload and thereby avoid a row-count underestimate #24.