Re: index prefetching - Mailing list pgsql-hackers

From Andres Freund
Subject Re: index prefetching
Date
Msg-id ngbvex7wfhzh63wjmrj3ll5ai3ae6pvxvus2lsmplvptdvsvjq@kupim2taa2mj
Whole thread Raw
In response to Re: index prefetching  (Peter Geoghegan <pg@bowt.ie>)
Responses Re: index prefetching
Re: index prefetching
List pgsql-hackers
Hi,

On 2025-12-17 13:49:43 -0500, Peter Geoghegan wrote:
> On Wed, Dec 17, 2025 at 12:19 PM Konstantin Knizhnik <knizhnik@garret.ru> wrote:
> > Moreover with `enable_indexscan_prefetch=off` results are the same.
> 
> It's quite unlikely that the current heuristics that trigger
> prefetching would have ever allowed any prefetching, for queries such
> as these.
> 
> The exact rule right now is that we don't even begin prefetching until
> we've already read at least one index leaf page, and have to read
> another one. So it's impossible to use prefetching with a LIMIT of 1,
> with queries such as these. It's highly unlikely that you'd see any
> benefits from prefetching even with LIMIT 100 (usually we wouldn't
> even begin prefetching).

Note that due to the tuple size and fillfactor in Konstantin's workload, there
will be one tuple per page... That should allow for some prefetching.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Kirill Reshke
Date:
Subject: Re: Adding vacuum test case of setting the VM when heap page is unmodified
Next
From: Jeff Davis
Date:
Subject: Re: Small patch to improve safety of utf8_to_unicode().