Re: index prefetching - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: index prefetching
Date
Msg-id CAH2-Wzng2c2RtgENok68XON8i1ypeQteXTmzcQyEjrqecnEd2w@mail.gmail.com
Whole thread Raw
In response to Re: index prefetching  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On Sat, Apr 4, 2026 at 1:33 AM Andres Freund <andres@anarazel.de> wrote:
> static inline bool
> index_scan_batch_loaded(IndexScanDescData *scan, uint8 idx)
> {
>         return (int8) (idx - scan->batchringbuf.headBatch) >= 0 &&
>                 (int8) (idx - scan->batchringbuf.nextBatch) < 0;
> }
>
> once the differences between the values don't fit into an int8 anymore.

The static assertion is incorrect (or not strict enough). It didn't
account for this int8 arithmetic. That'll be fixed in the next
version; the true maximum number of batches is 128 (still more than
anybody is likely to ever need).

> But I'm tired.

Same.

--
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: PG 19 release notes and authors
Next
From: Alvaro Herrera
Date:
Subject: Re: Adding REPACK [concurrently]