model-writtenrun 3594 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Andy Fan opened the thread with a fractional-cost implementation intended to improve fast-start Append plans, especially UNION ALL with LIMIT, while also considering partitioned scans, partitionwise joins, and EXISTS queries #1.
- Andy outlined an alternative that retained both cheapest-total and cheapest-startup choices #2, and David Rowley supplied a much smaller implementation that added a separate startup AppendPath whenever consider_startup was set #3.
- Andy argued that fractional costs could select a better intermediate path #4, while David questioned passing the same tuple fraction to every Append child and highlighted upper operations that could require additional rows #5; Andy supplied join-based examples and acknowledged the overlooked sorting and aggregation cases #6.
- Andy combined the two approaches in a revised patch, adding per-relation tuple fractions and an upper-operation flag while retaining separate startup paths where fractional planning was unavailable #7.
- David identified initialization, documentation, and row-estimate concerns and proposed landing only the simpler startup-path change first #8; Andy agreed, having found no example demonstrating an additional benefit from fractional costing #9.
- David added a UNION ALL/LIMIT regression test to his smaller patch #10, Andy approved it #11, and David committed it unchanged as a8a968a821 and announced the push #12.
- Several months later, Thomas Munro reported a buildfarm failure in which the new regression test reversed the tenk1 and tenk2 join order #13.
- Andy investigated the equal-cost alternatives and proposed shrinking one join input with t1.ten > 5 to stabilize the expected plan #15.
- David found that Andy's filter left only a small relative cost difference, proposed t2.thousand = 0 instead, and verified that the revised query still exercised the cheap-startup Append behavior #16; Andy confirmed the findings and approved the adjustment #17.
- David committed the adjusted test fix as 1fe66680c0, then demonstrated that decreasing relpages by one could reverse the original plan while leaving the revised test stable and announced the push #18.
- By the final message, the startup-path improvement and its test-stabilization follow-up had landed #18, while the broader fractional-cost extension remained deferred pending a convincing example of additional benefit #8 #9.