Re: AIO / read stream heuristics adjustments for index prefetching

From: Melanie Plageman <melanieplageman(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Peter Geoghegan <pg(at)bowt(dot)ie>, Tomas Vondra <tv(at)fuzzy(dot)cz>
Subject: Re: AIO / read stream heuristics adjustments for index prefetching
Date: 2026-04-03 16:45:50
Message-ID: CAAKRu_bWPO-w3arE3pM5i5LArp7mA+Rg0chm-1WL-JxvDxv7Cg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Apr 2, 2026 at 9:33 AM Andres Freund <andres(at)anarazel(dot)de> wrote:
>
> > + /*
> > + * XXX: Should we actually reduce this at any time other than
> > + * a reset? For now we have to, as this is also a condition
> > + * for re-enabling fast_path.
> > + */
> > + if (stream->combine_distance > 1)
> > + stream->combine_distance--;
> >
> > I don't think we need to reduce this other than reset.
>
> Hm. I go back and forth on that one :)

Separate from the fast-path enablement, we also probably want to
decrease combine distance when we decrease readahead_distance because
there is a point where we still want to parallelize the IOs even when
the distance is lower and to do that, we need to make smaller IOs. I'm
not sure where this point is, but I wonder if a few 256kB IOs is
faster than 1 1MB IO (could test that with fio actually). I imagine
that there is some size where that is true because of peculiarities in
how drives (and cloud storage) issue/break up IOs after they are a
certain size, etc.

- Melanie

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2026-04-03 16:47:40 Re: Add pg_stat_autovacuum_priority
Previous Message Haibo Yan 2026-04-03 16:42:20 Re: Extract numeric filed in JSONB more effectively