model-writtenrun 4432 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Nathan Bossart proposed pg_buffercache_usage_counts() after Jeremy Schneider requested easier monitoring of usage-count distributions, supplying a patch that reports buffer, dirty, and pinned totals for each possible usage count and suggesting modification of the existing summary function as an alternative #1.
- Discussion resumed in April when Greg Stark questioned aggregation and suggested exposing raw data; Andres Freund explained that pg_buffercache already exposes raw data but SQL aggregation is much slower than the summary functions #2 #6 #7.
- Robert Haas proposed replacing the summary's average usage count with a six-element integer array, initially supported by Tom Lane, while Melanie Plageman described the convenience of a single-row overview and the greater versatility of separate rows #3 #4 #5.
- Nathan offered to implement the array approach but noted that it would lose per-usage-count dirty and pinned totals; Robert accepted a row-based alternative, and Tom preferred rows because they are easier to manipulate in SQL #9 #10 #11.
- Andres favored preserving the single-row summary and adding a separate distribution function; Nathan pointed out that his original patch already did this, and Tom ultimately supported that design despite Robert's remaining reservations about retaining the average #12 #14 #16 #17.
- Nathan resubmitted the distribution function with an optional second patch replacing the summary's average with an array, allowing both changes to be considered independently #18.
- Tom committed only the distribution function as f3fa31327e, removing its invalid-buffer exclusion so the zero-usage row remains useful and buffer totals agree with shared_buffers, alongside SQL and documentation cleanup #19.
- Nathan accepted the adjustment and thanked Tom; the distribution function had landed, while the optional summary-array change remained uncommitted because consensus was uncertain #19 #20.