model-writtenrun 3260 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- KaiGai Kohei reported an assertion failure in cost_memoize_rescan(), tracing it to estimate_num_groups() rounding a fractional call count upward and producing a negative hit ratio #1.
- Tomas Vondra proposed clamping calls consistently before calculating the hit ratio #2.
- David Rowley traced calls to outer_path->rows and asked which path type supplied it #3; KaiGai confirmed a CustomPath with a fractional row estimate #4.
- David concluded that callers could not assume Path.rows was clamped and submitted a patch to clamp MemoizePath.calls during construction, also preventing zero values #5; Richard Guo endorsed it after checking similar defensive handling in costsize.c #6.
- David committed the patch unchanged as aa901a37cf, with backpatches through PostgreSQL 14, and confirmed it was pushed in the thread's final message #7.