model-writtenrun 8053 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Önder Kalacı reported an assertion failure with more than 500 LEFT JOIN relations in PostgreSQL 13, while builds without assertions completed the query #1.
- David Rowley reproduced the failure with 379 joins and traced it to overflowing row estimates, proposing both local DBL_MAX guards and centralized clamping #2; Tom Lane explained the repeated estimate multiplication and initially questioned fixing such an extreme case #3.
- Tom identified infinity multiplied by zero as the source of NaN and suggested a local correction #5, but David's concern about NaN costs #6 led Tom to support centralized handling after finding similar problems in nested-loop costing #7.
- David's first attachment centralized infinity and NaN handling and eliminated zero-row Append paths, but he reported that DBL_MAX still allowed sort costs to overflow #10.
- Tom rejected prohibiting zero-row paths because they represent legitimate cases, recommended mapping NaN to a large estimate rather than one, and proposed a 1e100 ceiling that leaves arithmetic headroom #11; David incorporated those changes in the second attachment #12.
- Tom clarified why 1e100 leaves room for multiplying two row estimates #13 and accepted the second attachment after checking its removal of local isnan guards #14; David clarified the discrepancy between his earlier prose and attachment #15 and committed that attachment unchanged as a90c950fc7.
- David then posted a separate stable-branch patch adding local DBL_MAX guards, arguing that assertion failures could undermine upgrade testing #17, while Tom opposed changing stable-branch behavior for this corner case #18.
- David proposed weakening the failing assertion instead #19, Tom recommended checking for NaN #20, and David confirmed reproduction as far back as PostgreSQL 9.5 #21.
- The stable-branch attachment was superseded by four NaN-tolerant assertions in 3798b4fe73, covering PostgreSQL 9.5 through 13; David's final message confirmed the backpatch, leaving both the master fix and the narrower stable-branch fix landed #22.