model-writtenrun 5373 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- David Rowley proposed allowing merge-join ordering to follow a query_pathkeys prefix covering all join clauses, enabling an incremental sort above the join and addressing plan regressions in his pending ORDER BY / DISTINCT aggregate work #1.
- David corrected his initial wrong-branch submission with a master-based version that preserved the planner logic and added a dedicated join regression test #2.
- Richard Guo suggested allowing a common prefix even when it did not cover every join clause, illustrating how that could enable additional incremental-sort plans #3.
- David explained that broader matching could undermine ordering heuristics for subsequent merge joins, while suggesting it might work for the final join; Richard accepted that reasoning, leaving the broader optimization unimplemented #4 #5.
- David committed #2 with only comment and formatting edits as b592422095, crediting Richard's review, and closed the thread by announcing the push #6.