model-writtenrun 4428 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Melanie Plageman proposed adding read, write, extend, and fsync times to pg_stat_io in #1, with documentation and a question about validating the relationship between operation counts and timings.
- Bertrand Drouvot supplied a rebase and requested consistent counting order, stronger validation, and a warning about changing track_io_timing in #2; Melanie incorporated those changes in #3, checking that nonzero timing implies nonzero counts rather than the reverse.
- Bertrand suggested resetting statistics when timing is toggled in #4, and Melanie explored NULL timings in #6, but Andres Freund rejected automatic resets because track_io_timing can differ between sessions and resetting would discard useful statistics in #7.
- Andres explained the value of aggregate timing and proposed future per-connection and database aggregates in #9; Bertrand suggested histograms in #10, while Sami Imseih proposed separate counts of timed operations in #11, neither of which entered this series.
- Andres requested centralized accounting and warned that instr_time was unsuitable for persistent aggregate storage in #5; Melanie introduced shared start/end helpers in #12, also exposing existing omissions in temporary-relation write accounting.
- After Andres clarified that pending values should remain instr_time while shared statistics should store microseconds in #13, Melanie implemented conversion on flush using a union in #14.
- Andres replaced that union with a separate pending-statistics structure and consolidated the counting API in the attached refactoring at #15, reported useful COPY timing results, and requested separate fixes for missing temporary-write accounting.
- Melanie folded Andres's changes into a four-patch series in #16: two temporary-relation accounting fixes, the main timing feature, and a follow-up using pending IO times for database counters, while raising questions about reset behavior and further local-buffer refactoring.
- Following a rebase for IO-hit counting in #17, Andres reviewed the series in #18; Melanie addressed his helper, validation, and loop comments and adapted timing to multi-block relation extension in #19.
- Andres committed the first two patches of #19 together without code changes as 704261ecc6, fixing temporary-relation write timing and missing FlushRelationBuffers() accounting.
- Andres committed the third patch of #19 as ac8d53dae5, simplifying time-column lookup and fixing fractional-millisecond truncation, with those edits documented in #20.
- During final verification, Andres traced differences from checkpoint-log write times to work outside pg_stat_io's measurements, particularly smgrwriteback(), and deferred the fourth patch because it required changing statistics-flush ordering and was less urgent than completing the view in #20.
- The thread resumed in August 2024 when Bertrand volunteered to pursue per-backend IO statistics in #21, then linked a separate proposal in #22, which Michael Paquier welcomed in #23; the timing feature and temporary-write fixes had landed, while the deferred database-counter refactoring had no subsequent landing shown here.