model-writtenrun 146 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- shihao zhong reported that restarting join removal left stale aggpresorted flags, producing incorrect aggregate results, and stale TABLESAMPLE arguments, triggering an assertion; #1 supplied two cleanup fixes and regression tests, and #2 corrected the reported wrong count to 30 instead of the expected 3.
- Tom Lane argued in #3 that pathkey computation should wait until after join removal, then supplied #4, which moved qp_callback outside the restart loop and passed the reported reproducer and check-world.
- In #5, shihao endorsed Tom's replacement after testing 2200 random self-join queries and both stable branches, confirmed the TABLESAMPLE fix was still needed, and reported another assertion caused by securityQuals retained after self-join elimination.
- Tom's callback relocation from #4 landed unchanged as 38fe5a9366, replacing the original proposal to reset aggregate flags.
- After acknowledging that landing, shihao submitted #6 with the remaining TABLESAMPLE fix, new securityQuals cleanup, and tests for both assertions, noting that the TABLESAMPLE failure also affected the older supported branches.
- The cleanup landed as d15ab66f50, whose supplied diff contains the TABLESAMPLE portion of #6 with comment edits; its listed backport 91b1872ff2 additionally contains the self-join securityQuals cleanup.
- Tom closed the thread in #7 by confirming the fixes were pushed and explaining that he omitted the regression tests because their ongoing runtime cost was not worthwhile; no further revision was requested.