Re: pgBufferUsage.blk_{read|write}_time are zero although there are pgBufferUsage.local_blks_{read|written}
Nazir Bilal Yavuz <byavuz81@gmail.com>
From: Nazir Bilal Yavuz <byavuz81@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Robert Haas <robertmhaas@gmail.com>,
Melanie Plageman <melanieplageman@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2023-10-16T10:07:07Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix description of I/O timing info for shared buffers in EXPLAIN (BUFFERS)
- 8dd70828b460 15.6 landed
- db69101a1d00 16.2 landed
-
pg_stat_statements: Add local_blk_{read|write}_time
- 5147ab1dd34a 17.0 landed
-
Add local_blk_{read|write}_time I/O timing statistics for local blocks
- 295c36c0c1fa 17.0 landed
-
Rename I/O timing statistics columns to shared_blk_{read|write}_time
- 13d00729d422 17.0 landed
-
Count write times when extending relation files for shared buffers
- 2308f18c0733 16.1 landed
- d17ffc734dad 17.0 landed
-
Add JIT deform_counter
- 5a3423ad8ee1 17.0 cited
Attachments
- v3-0001-Include-IOOp-IOOP_EXTENDs-while-calculating-block.patch (text/x-diff) patch v3-0001
- v3-0003-Add-local_blk_-read-write-_time-I-O-timing-statis.patch (text/x-diff) patch v3-0003
- v3-0002-Rename-I-O-timing-statistics-columns-to-shared_bl.patch (text/x-diff) patch v3-0002
Hi,
On Tue, 10 Oct 2023 at 03:54, Michael Paquier <michael@paquier.xyz> wrote:
>
> 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.
Yes, that could be a better solution. Also, having more detailed stats
for shared and local buffers is helpful. I updated patches in line
with that:
0001: Counts extends same way as a write.
0002: Rename blk_{read|write}_time as shared_blk_{read|write}_time.
0003: Add new local_blk_{read|write}_time variables.
Regards,
Nazir Bilal Yavuz
Microsoft