model-writtenrun 1215 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Pavel Stehule reported that SELECT expr INTO var was much slower than direct assignment in PL/pgSQL, presenting benchmarks across PostgreSQL versions and asking whether the gap could be reduced #1.
- Tom Lane proposed bypassing SPI for a simple expression assigned to a single variable, recovering nearly all the performance difference while identifying changed pg_stat_statements visibility and error context as compatibility concerns #2.
- Pavel tested the patch, confirmed a substantial speedup, and argued that users would reasonably expect assignment-like optimization despite the statistics difference #3.
- Pavel later supplied a dedicated error-context callback and immediately corrected the attachment to remove an obsolete expected-output change; he suggested documenting the remaining pg_stat_statements difference #4 #5.
- Tom committed the corrected patch as ce8d5fe0e2, with additional syntax-error handling and separate evaluation and assignment steps to preserve error-context behavior, plus regression tests; he explained that decision and declined a documentation addition because direct assignments' absence from statistics was likewise undocumented #6.
- The thread ended with Pavel thanking Tom after the optimization landed, with no further patch revisions or unresolved implementation requests #7.