model-writtenrun 3921 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Bertrand Drouvot proposed moving live-subtransaction counter reconciliation into find_tabstat_entry() and removing PgStat_BackendFunctionEntry in #1, crediting an earlier idea from Andres Freund and aiming to simplify transaction-statistics SQL functions.
- Kyotaro Horiguchi questioned the extra allocation and reconciliation costs in #2; Andres Freund argued in #4 and #5 that these costs belonged in the infrequently used statistics readers rather than performance-critical collection paths, and recommended structure assignment, simpler control flow, and dropping individual frees.
- Bertrand split the function-entry cleanup into separate planned work and briefly added a reconciliation flag in #6, then removed the flag in #8 after Kyotaro favored hiding the implementation details from callers in #7.
- Kyotaro identified a regression that discarded successful shared-relation lookups in #9, leading to #10; his ownership-documentation review in #11 and Andres's correction in #13 then produced comments explaining the returned copy and callers' possible need to free it in #14.
- Michael Paquier raised performance and copied-subtransaction-pointer concerns in #15 and #17, while also discovering that two externally used transaction block-statistics functions lacked documentation; he recommended documenting those two functions without restoring every omitted function description in #19.
- Bertrand supplied the missing documentation in #20 and incorporated wording feedback from Michael and Kyotaro into #25; Michael committed it with punctuation and wrapping edits as d69c404c4c and confirmed backpatching in #26.
- After that landing, Melanie Plageman explained in #27 that 'buffers fetched' obscured the inclusion of cache hits, prompting Michael to propose block-read-request terminology in #28.
- The code refactor remained under discussion: Michael reconsidered an optional reconciliation flag in #29, Andres opposed unnecessary optimization in #30, and Michael reported acceptable timings with 10,000 subtransactions in #31 while retaining his concern about the copied subtransaction pointer.
- Melanie endorsed the revised terminology in #32, and Kyotaro argued in #34 that the documentation also needed to explain fetched-minus-hit and kernel read() calls; Bertrand proposed concrete wording in #36 and attached the follow-up documentation patch in #40.
- Michael committed #40 as e126d817c7, additionally explaining kernel buffering and physical reads, and described that final addition in #42.
- After several months, Bertrand revived the refactor with #43, rebasing it onto renamed counter fields and existing macro infrastructure while explicitly asking how to resolve the outstanding copied-pointer concern.
- Michael clarified that the returned copy should clear its trans pointer in #44; Bertrand implemented that safeguard and indentation fixes in #45, which Michael approved in #46 and committed with comment edits as bf01e1ba96.
- Michael confirmed the refactor's application in #47, and Andres closed with thanks in #48; the reconciliation work and both documentation fixes had landed, while the PgStat_BackendFunctionEntry cleanup split off in #6 has no further outcome recorded in this thread.