model-writtenrun 5611 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- David Rowley proposed window-function run conditions for PostgreSQL 15 in #1, allowing pagination queries to stop work once monotonic results exceed a bound while retaining outer equality filters where necessary; support for MIN and MAX was left out because he doubted its practical value.
- David resolved his initial support-API uncertainty in #3 by making callbacks report increasing, decreasing, constant, or nonmonotonic behavior and moving expression construction into the planner; #5 incorporated Zhihong Yu's bit-test simplification from #4.
- Andy Fan demonstrated incorrect results with differently ordered window functions in #6, and his investigation in #8 identified sorting and peer-order constraints that made simply rearranging window evaluation problematic.
- After roughly seven months, David resumed the patch in #12, choosing to disable the optimization for multiple window clauses rather than change evaluation order without adequate costing, and added regression coverage for Andy's report.
- Greg Stark proposed LIMIT-style planning and top-N sorting in #9, but David deferred that extension in #13 because the current monotonicity API does not establish exact row limits for functions such as rank; the QUALIFY syntax discussion in #10, #14, and #18 produced no implementation in this series.
- Zhihong Yu identified duplicated planner logic in #15, and David consolidated operator handling and function validation in #16.
- David reconsidered the multiple-window restriction in #17 and implemented pass-through execution in #19, allowing intermediate WindowAggs to preserve all tuples while skipping function evaluation and allowing partitioned queries to continue into subsequent partitions.
- Andres Freund explained the similarity between precomputed aggregate values and slot references in #20, addressing David's concern about evaluating run conditions from previously computed results; David followed with comment and initialization cleanup in #21.
- Andy supplied three experimental executor deltas and performance measurements in #24, proposing that partition tails be skipped and filtering move into WindowAgg; David supplied an alternative spool_tuples() delta in #26 to avoid unnecessary tuplestore writes.
- Andy clarified in #27 that intermediate windows still need pass-through tuples and suggested bypassing run-condition checks for subqueries without window functions, so his proposed elimination of the state machinery was not adopted.
- David integrated the revised approach in #28, adding strict pass-through for top-level partitioned windows, preserving intermediate tuples, and collecting lower-window conditions as ordinary filters on the top WindowAgg because intervening sorts can destroy monotonic ordering.
- Zhihong caught an obsolete comment in #29, David posted the cleaned and formatted final patch in #31, and Zhihong made a further documentation suggestion in #32.
- David committed #31 as 9d9c02ccd1 with only formatting, a comment clarification, and a catalog-version bump, then confirmed completion in #33; the submitted feature landed, with LIMIT-style planning and additional aggregate support remaining outside its scope.