model-writtenrun 3087 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Peter Eisentraut proposed copying scan keys before remapping their attribute numbers, allowing callers to reuse their keys safely; he also supplied a const-qualification proof patch and an independent memcpy cleanup, explicitly deferring the incompatible public API changes #1.
- Robert Haas raised the cost of additional allocations, while Tom Lane considered that cost unlikely to matter within an index scan #2 #3.
- Noah Misch identified caller comments and copying that depended on scan-key mutation, and Tom asked whether removing redundant work could offset the allocation overhead #4 #5.
- Peter retained the original patches and added caller cleanup plus an optional stack-array implementation, while expressing a preference for allocating the converted keys with palloc #6.
- Peter selected the copying fix, memcpy cleanup, and caller cleanup for commitment, folding the caller cleanup into the main fix and leaving out const qualification and the stack-array alternative #7.
- The memcpy component of #6 landed unchanged apart from rebasing as 8b5c6a54c4, followed by the combined scan-key-copying and caller-cleanup components as 811af9786b.
- Justin Pryzby subsequently reported that the new allocations accumulated during ANALYZE of a wide partitioned table; Peter proposed corresponding pfree calls, and Justin confirmed that he had tested them successfully #8 #9 #10.
- Peter added explicit frees in both system-table scan functions in 1acf10549e and confirmed completion in the final message, resolving the reported regression while broader caller memory-management improvements remained only a possibility #11 #9.