Re: index prefetching

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: Tomas Vondra <tomas(at)vondra(dot)me>, Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Robert Haas <robertmhaas(at)gmail(dot)com>, Melanie Plageman <melanieplageman(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Georgios <gkokolatos(at)protonmail(dot)com>, Konstantin Knizhnik <knizhnik(at)garret(dot)ru>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Subject: Re: index prefetching
Date: 2025-08-05 23:30:23
Message-ID: CA+hUKGKo71OYOK0rL2qnNNXeNpkpsgZdqg5WSTMHDrEqHq_9Dw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Aug 6, 2025 at 9:35 AM Peter Geoghegan <pg(at)bowt(dot)ie> wrote:
> On Tue, Aug 5, 2025 at 4:56 PM Tomas Vondra <tomas(at)vondra(dot)me> wrote:
> > True, the complex patch could prefetch the leaf pages.

There must be a similar opportunity for parallel index scans. It has
that "seize the scan" concept where parallel workers do one-at-a-time
locked linked list leapfrog.

> What I meant was that the complex patch can make up for the fact that
> direct I/O presumably won't ever have an equivalent to simple
> read-ahead. Just by having a very flexible prefetching implementation
> (and without any special sequential access heuristics ever being
> required).

I'm not so sure, there are certainly opportunities in different layers
of the system. I'm going to dust off a couple of experimental patches
(stuff I talked to Peter about back in Athens), and try to describe
some other vague ideas Andres and I have bounced around over the past
few years when chatting about what you lose when you turn on direct
I/O. Basically, the stuff that we can't fix with "precise" I/O
streaming as I like to call it, where it might still be interesting to
think about opportunities to do fuzzier speculative lookahead. I'll
start a new thread.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Shinya Kato 2025-08-06 00:15:21 Re: Add backup_type to pg_stat_progress_basebackup
Previous Message 厉超 2025-08-05 23:26:35 Re: Fixed a minor typo in code comment