model-writtenrun 7291 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- David Rowley proposed restoring single-column byref Datum sorts after a memory leak had caused that optimization to be disabled, using a new tuplesort_getdatum_nocopy() function to avoid allocating returned Datums #1.
- The initial patch also avoided unnecessary Datum copies for duplicate DISTINCT aggregate inputs; David reported performance gains for both aggregates and sorting, while leaving a possible similar optimization of mode_final() outside the patch #1.
- Following discussion elsewhere, David replaced the separate function with a copy parameter on tuplesort_getdatum(), retaining the same optimization strategy #2.
- The revised patch also used copy=false in heapam_index_validate_scan() to eliminate conditional freeing on 32-bit systems, and David announced his intention to commit absent objections #2.
- David committed the revised patch #2 as d37aa3d358 with only a comment punctuation change, then confirmed it was pushed, completing the submitted work #3.