Refactor pgstat_prepare_io_time() with an input argument instead of a GUC
Michael Paquier <michael@paquier.xyz>
Refactor pgstat_prepare_io_time() with an input argument instead of a GUC Originally, this routine relied on track_io_timing to check if a time interval for an I/O operation stored in pg_stat_io should be initialized or not. However, the addition of WAL statistics to pg_stat_io requires that the initialization happens when track_wal_io_timing is enabled, which is dependent on the code path where the I/O operation happens. Author: Nazir Bilal Yavuz Discussion: https://postgr.es/m/CAN55FZ3AiQ+ZMxUuXnBpd0Rrh1YhwJ5FudkHg=JU0P+-W8T4Vg@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/storage/buffer/bufmgr.c | modified | +5 −5 |
| src/backend/storage/buffer/localbuf.c | modified | +2 −2 |
| src/backend/storage/smgr/md.c | modified | +2 −2 |
| src/backend/utils/activity/pgstat_io.c | modified | +12 −2 |
| src/include/pgstat.h | modified | +1 −1 |
Discussion
- Show WAL write and fsync stats in pg_stat_io 94 messages · 2023-06-28 → 2025-03-19