Re: AIO / read stream heuristics adjustments for index prefetching - Mailing list pgsql-hackers

From Melanie Plageman
Subject Re: AIO / read stream heuristics adjustments for index prefetching
Date
Msg-id CAAKRu_aG2zvObX6gQ3Kw=MPydbphZ-qKeMGwZDEFe55FFiXYWw@mail.gmail.com
Whole thread
In response to AIO / read stream heuristics adjustments for index prefetching  (Andres Freund <andres@anarazel.de>)
Responses Re: AIO / read stream heuristics adjustments for index prefetching
List pgsql-hackers
On Tue, Mar 31, 2026 at 12:02 PM Andres Freund <andres@anarazel.de> wrote:
>
> 0008: WIP: read stream: Split decision about look ahead for AIO and combining
>
>     Until now read stream has used a single look-ahead distance to control
>     lookahead for both IO combining and read-ahead. That's sub-optimal, as we
>     want to do IO combining even when we don't need to do any readahead, as
>     avoiding the syscall overhead is important to reduce CPU overhead when
>     data is in the kernel page cache.
>
>     This is a prototype for what it could look like to split those
>     decisions. Thereby fixing the regression mentioned in 0006.

I wonder if we need to keep the combine_limit member in the read
stream. Could we just use io_combine_limit without ramping up and
down? This is mainly for code complexity reasons. Perhaps to allow
fast path reentry, we could use distance_decay_holdoff == 0 and
ios_in_progress == 0 instead of combine_distance == 0.

- Melanie



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: 'Bad file descriptor: dup2( 1, 2 )' error on MacOS CI tasks
Next
From: Nathan Bossart
Date:
Subject: Re: DOCS - DROP SUBSCRIPTION does not document parameter "IF EXISTS"