Re: index prefetching

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tomas Vondra <tomas(at)vondra(dot)me>, Alexandre Felipe <o(dot)alexandre(dot)felipe(at)gmail(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>, 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: 2026-02-28 19:32:35
Message-ID: CAH2-Wz=EVnDidFckVXq=iA=ugix=r986VUepmXO3c+1xt951Qw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Feb 27, 2026 at 7:37 PM Andres Freund <andres(at)anarazel(dot)de> wrote:
> I do continue to wonder if we ought to pass down some hints from the planner
> about how much data an indexscan is likely to read to influence readahead
> aggressiveness.

As you know, I already have some of that, but it isn't particularly
well developed. I agree that pushing the hinting mechanism further and
using something like your proposed READ_STREAM_SLOW_START mechanism
(which you mention in your later email from today) seems most
promising.

> I do agree it's right beign concerned about the increase in index fetches with
> such mark/restore cases.

> Is this, by any chance, with starting the server and running these queries in
> that order? Are you repeating these runs within one server start, evicting
> the buffers inbetween?

Yes, I repeat the runs 3 times, evicting/prewarming as needed each
time. I go with the fastest run.

> Are you using huge pages? I see rather differing performance results
> with/without when not prefetching.

Yes, I always use huge_pages (and never use transparent huge pages).

> It really shouldn't be sensitive - that query will never be able to reuse
> heapam pages within a query, and evicting a clean buffer isn't that expensive.

Could have been my previous failure to use "cpupower idle-set -D 0" to
get maximally stable performance for my microbenchmarks. As discussed
privately, I've added this as yet another step in the script that
automates all this for me/that prepares my system to run a
microbenchmark.

--
Peter Geoghegan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2026-02-28 19:42:47 Re: index prefetching
Previous Message Peter Geoghegan 2026-02-28 19:16:22 Re: index prefetching