model-writtenrun 1161 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tom Lane reported quadratic memory growth during jsonpath evaluation and proposed compact, growing JsonValueList chunks with explicit cleanup, retaining materialized results rather than redesigning evaluation #1.
- Chao Li tested the initial patch and reported stable memory near 30MB instead of tens of gigabytes, plus much faster execution; he abandoned an extra total-item counter after finding no benefit and clarified that his benchmarks used optimized builds without assertions #2 #3.
- Tom Lane explained that counting geometrically growing chunks was logarithmic in the number of values, but recognized that callers only needed zero, one, or multiple-item checks and submitted those constant-time checks alongside the unchanged original patch #4.
- Chao Li reported a speedup even on smaller inputs without severe memory pressure, reviewed the new checks, and suggested clearer naming and const-qualified parameters #5.
- Tom Lane squashed both patches from #4 into 5a2043bf71, adopting JsonValueListHasMultipleItems and const parameters while retaining JsonValueListIsSingleton; his final message confirmed the work had landed and deferred broader iterator const qualification as unnecessary scope for this patch #6.