model-writtenrun 3757 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- RekGRpth reported that a table with many very wide character columns produced a negative EXPLAIN width #1, and Richard Guo confirmed an assertion failure and initially suggested raising an error #2.
- Julien Rouhaud warned that errors could break existing queries involving wide joins #3, while Tom Lane proposed clamping estimates to MaxAllocSize #4; Richard implemented that approach in two width-estimation functions #5.
- RekGRpth questioned overflow that wraps back into the allowed range #6, and Tom initially characterized the likely production consequence as a poor plan choice #7.
- Alexander Lakhin approved the initial width patch and supplied a separate UBSan reproducer for bitmap-scan costing overflow #8; Richard traced it to compute_bitmap_pages() converting loop_count from double to int and proposed correcting the parameter type #9.
- Tom supported the bitmap parameter correction but opposed backpatching its exposed ABI change #10, and Richard agreed that fixing only the development branch was sufficient #13.
- Tom's width-patch review called for protecting joins, accumulating in double before clamping, and sharing the clamp logic #11; Richard's expanded patch also covered placeholders, window targets, and relation-width calculations, and bundled the bitmap fix #14.
- Junwang Zhao proposed using int64 instead of double for width accumulation and supplied a simpler clamp implementation #15.
- Tom committed the bitmap portion of #14 separately as 8b965c549d, adding comments and clearer output-parameter names while retaining the decision against backpatching.
- Tom then posted a revised width patch that retained double accumulation, handled NaN, centralized nonnegative assertions, and clamped inside get_rel_data_width() to preserve its integer interface and callers' integer division #16.
- Richard checked other width assignments and endorsed the revised patch #17, then said double was adequate when Tom revisited the datatype choice #18 #19.
- Tom ultimately adopted Junwang's int64 proposal because the datatype distinguishes widths from other planner estimates #20, committing #16 with that change and expanded comments as 7e1ce2b3de.
- Both fixes landed only on the development branch, with the width issue also judged too artificial to warrant backpatching #20; Richard's final reply acknowledged the push and agreed with that scope, leaving no attached work outstanding #21.