Re: index prefetching

From: Tomas Vondra <tomas(at)vondra(dot)me>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: Andres Freund <andres(at)anarazel(dot)de>, 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: 2025-08-25 17:13:56
Message-ID: 3a5f09ad-d588-4a5c-9ea5-8dfddbdae3a1@vondra.me
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 8/25/25 16:18, Tomas Vondra wrote:
> ...
>
> But with more hits, the hit/miss ratio simply determines the "stable"
> distance. Let's say there's 80% hits, so 4 hits to 1 miss. Then the
> stable distance is ~4, because we get a miss, double to 8, and then 4
> hits, so the distance drops back to 4. And again.
>

I forgot to mention the distance is "stable" only if you already start
at it - then we keep it. But start at a higher value, and the distance
keeps growing. Or start at a lower value, and it collapses to 1. Plus
it's rather sensitive, a minor variation can easily push the distance in
either direction.

So it's more like an "unstable equilibrium" in physics.

regards

--
Tomas Vondra

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Antonin Houska 2025-08-25 17:22:14 Re: Adding REPACK [concurrently]
Previous Message Ranier Vilela 2025-08-25 17:03:11 Re: use PqMsg macros in fe-protocol3.c