| From: | Tomas Vondra <tomas(at)vondra(dot)me> |
|---|---|
| To: | Melanie Plageman <melanieplageman(at)gmail(dot)com> |
| Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: EXPLAIN: showing ReadStream / prefetch stats |
| Date: | 2026-03-17 17:51:15 |
| Message-ID: | 0fa0794e-7e34-4fdb-8e35-a59ef8ce5246@vondra.me |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On 3/16/26 18:49, Tomas Vondra wrote:
> On 3/16/26 18:14, Melanie Plageman wrote:
>> ...
>>
>> I see a couple more issues with the counting in read_stream.c.
>>
>> You are double-counting stalls for synchronous IO. You increment
>> stalls in read_stream_next_buffer() but we actually execute
>> synchronous IO in WaitReadBuffers and return needed_wait as true,
>> which will count a stall again.
>>
>> You are not counting fast path IOs because those don't go through
>> read_stream_start_pending_read() and instead are started directly by
>> StartReadBuffer() in read_stream_next_buffer(). Simple diff attached
>> should fix this.
>>
>> Also, per worker stats are not displayed when BUFFERS false is passed
>> even with IO true because of a small oversight. I fixed it in the
>> attached diff.
>>
>
> Thanks!
>
Here's a v2 with your fixes merged. No other changes.
regards
--
Tomas Vondra
| Attachment | Content-Type | Size |
|---|---|---|
| v2-0001-bufmgr-Return-whether-WaitReadBuffers-needed-to-w.patch | text/x-patch | 2.8 KB |
| v2-0002-explain-show-prefetch-stats-in-EXPLAIN-ANALYZE-VE.patch | text/x-patch | 35.1 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Greg Burd | 2026-03-17 18:04:11 | Re: Expanding HOT updates for expression and partial indexes |
| Previous Message | Masahiko Sawada | 2026-03-17 17:50:35 | Re: Emitting JSON to file using COPY TO |