On Thu, Oct 05, 2023 at 08:51:40AM -0400, Robert Haas wrote: > On Thu, Oct 5, 2023 at 6:25 AM Nazir Bilal Yavuz <byavu...@gmail.com> wrote: >> What do you think about the second patch, counting extend calls' >> timings in blk_write_time? In my opinion if something increments >> {shared|local}_blks_written, then it needs to be counted in >> blk_write_time too. I am not sure why it is decided like that. > > I agree that an extend should be counted the same way as a write. But > I'm suspicious that here too we have confusion about whether > blk_write_time is supposed to be covering shared buffers and local > buffers or just shared buffers.
Agreed. In ~14, as far as I can see blk_write_time is only incremented for shared buffers. FWIW, I agree that we should improve these stats for local buffers but I am not on board with a solution where we'd use the same counter for local and shared buffers while we've historically only counted the former, because that could confuse existing monitoring queries. It seems to me that the right solution is to do the same separation as temp blocks with two separate counters, without a backpatch. I'd like to go as far as renaming blk_read_time and blk_write_time to respectively shared_blk_read_time and shared_blk_write_time to know exactly what the type of block dealt with is when querying this data, particularly for pg_stat_statements's sake. -- Michael
signature.asc
Description: PGP signature