Re: AIO / read stream heuristics adjustments for index prefetching
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Melanie Plageman <melanieplageman@gmail.com>
Cc: pgsql-hackers@postgresql.org, Thomas Munro <thomas.munro@gmail.com>, Peter Geoghegan <pg@bowt.ie>, Tomas Vondra <tv@fuzzy.cz>, Nazir Bilal Yavuz <byavuz81@gmail.com>
Date: 2026-04-03T20:41:18Z
Lists: pgsql-hackers
Hi, Forgot to send this one earlier: On 2026-04-03 11:46:59 -0400, Melanie Plageman wrote: > On Thu, Apr 2, 2026 at 11:47 AM Andres Freund <andres@anarazel.de> wrote: > > > > What do you think about the updated patch to achieve that that I posted? > > here is some review on 0005 and 0006 earlier posted > concrete things: > ------- > - I’d reorder stream→distance == 0 in read_stream_look_ahead() (and > issue), I found myself asking why it wasn’t first It'd not be correct in should_issue_now(). We can't move it before /* there is no pending IO that could be issued */ if (pending_read_nblocks == 0) return false; because then we'd trigger a call to read_stream_start_pending_read(), without there being a pending read. We can't move it before /* never start more IOs than our cap */ if (stream->ios_in_progress >= stream->max_ios) return false; because that could lead us to exceeding max_ios. Greetings, Andres Freund
Commits
-
aio: io_uring: Trigger async processing for large IOs
- a9ee66881744 19 (unreleased) landed
-
read stream: Split decision about look ahead for AIO and combining
- 8ca147d582a5 19 (unreleased) landed
-
read_stream: Move logic about IO combining & issuing to helpers
- 434dab76ba76 19 (unreleased) landed
-
read_stream: Only increase read-ahead distance when waiting for IO
- f63ca3379025 19 (unreleased) landed
-
read_stream: Prevent distance from decaying too quickly
- 6e36930f9aaf 19 (unreleased) landed
-
read_stream: Issue IO synchronously while in fast path
- cceb1bf45e3a 19 (unreleased) landed
-
aio: io_uring: Allow IO methods to check if IO completed in the background
- 6e648e353fa0 19 (unreleased) landed
-
bufmgr: Return whether WaitReadBuffers() needed to wait
- 513374a47a71 19 (unreleased) landed