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-04-04 23:35:28
Message-ID: CAH2-Wzng2c2RtgENok68XON8i1ypeQteXTmzcQyEjrqecnEd2w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Apr 4, 2026 at 1:33 AM Andres Freund <andres(at)anarazel(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2026-04-04 23:53:09 Re: Adding REPACK [concurrently]
Previous Message Bruce Momjian 2026-04-04 23:34:13 Re: PG 19 release notes and authors