model-writtenrun 1793 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- David Rowley reported that truncate_useless_pathkeys() discarded useful ordering information for queries combining window functions and ORDER BY, causing an unnecessary Incremental Sort despite a suitable index #1.
- His patch checked sort_pathkeys explicitly for final ordering and added a separate window_pathkeys check to preserve ordering needed by window functions #1.
- The submission added a regression test demonstrating an Index Only Scan feeding WindowAgg without additional sorting, while leaving broader code-reuse cleanup for a separate commit #1.
- David Rowley committed the patch as a5a68dd6d5, retaining its implementation and tests with only comment corrections and an expanded commit explanation.
- David Rowley announced that the fix had been pushed to master, closing the thread without other participants reviewing it or further revisions being requested #2.