model-writtenrun 4911 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tom Lane reported a partitionwise-join planning failure encountered while developing outer-join-aware Vars and attached MaterialPath support for reparameterize_path_by_child(), initially proposing to backpatch it despite lacking a reproducer on HEAD #1.
- Richard Guo reproduced the failure on HEAD using TABLESAMPLE and a lateral reference #2, and Ashutosh Bapat reviewed the attachment favorably after reconsidering why MaterialPath had originally been omitted #3.
- Richard demonstrated that supporting MaterialPath in reparameterize_path() could also produce better parameterized append plans, supplied an inline implementation #4, and then added a necessary check for failed subpath reparameterization #5.
- Tom separated the correctness issue from the missing optimization: unsupported path types should remain permissible, and partitionwise joining should fall back to a non-partitionwise join when every child path fails reparameterization #6.
- Tom committed that fallback separately as fe12f2f8fa, checking for an empty child pathlist and setting the parent's nparts to zero before returning; the fix was backpatched to all supported versions, with no regression test because extending path-type support would make the known reproducer stop exercising the fallback.
- Tom then committed the attachment from #1 together with Richard's inline extension and NULL check from #5 as 6eb2f0ed4c, treating MaterialPath support in both functions as a planning improvement.
- After the commits, Ashutosh proposed skipping set_cheapest() for children without paths #7; Tom explained that higher levels also needed the parent marked unpartitioned and that the committed fix followed the existing nparts convention despite his preference for using consider_partitionwise_join #8.
- Ashutosh endorsed the fix and defended clearing nparts while suggesting named helper macros #9; Tom remained unconvinced by the semantic argument but agreed that an explanatory macro would help, leaving that cleanup as a suggestion after both functional changes had landed #10.