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-07-07 23:00:32
Message-ID: CAH2-WzmsebafEMoBp-sWq+Dp75SKV6j+RWerKSJNfJkWV592tg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jun 22, 2026 at 4:48 PM Peter Geoghegan <pg(at)bowt(dot)ie> wrote:
> V28 is attached.

V29 is attached. This revision focuses on avoiding small regressions
in pgbench SELECT, particularly at higher client counts, where we're
particularly sensitive to iTLB pressure. I'm posting this new revision
now because V29 no longer applies cleanly; not much has changed since
V28.

Highlights:

* Microoptimization: index AMs are now allowed to set
knownEndBackward/knownEndForward fields just as amgetbatch returns.
This allows simple point lookup queries to call amgetbatch exactly
once.

* Microoptimization: pgstat_count_index_tuples now runs once per
batch, not once per tuple as before. This slightly changes the
semantics of the underlying counter, making it consistent with what
we've always done with bitmap index scans: index tuples returned by
the index AM are always counted, even when they're not returned to the
core executor.

* V29 also includes a new EXPLAIN (ANALYZE, IO) patch. This new patch
shows standard read stream instrumentation info when EXPLAIN ANALYZE
runs an index scan that performs IO prefetching.

--
Peter Geoghegan

Attachment Content-Type Size
v29-0011-aio-Fix-pgaio_io_wait-for-staged-IOs-B.patch application/octet-stream 6.3 KB
v29-0012-WIP-aio-bufmgr-Fix-race-condition-leading-to-dea.patch application/octet-stream 3.1 KB
v29-0009-Add-EXPLAIN-IO-support-for-plain-index-scans.patch application/octet-stream 13.8 KB
v29-0001-Add-slot-based-table-AM-index-scan-interface.patch application/octet-stream 116.1 KB
v29-0010-Allow-read_stream_reset-to-not-wait-for-IO-compl.patch application/octet-stream 20.7 KB
v29-0008-heapam-Add-index-scan-I-O-prefetching.patch application/octet-stream 55.1 KB
v29-0007-heapam-Optimize-pin-transfers-during-index-scans.patch application/octet-stream 6.2 KB
v29-0005-WIP-Adopt-amgetbatch-interface-in-GiST-index-AM.patch application/octet-stream 111.7 KB
v29-0006-WIP-Adopt-amgetbatch-interface-in-SP-GiST-index-.patch application/octet-stream 68.9 KB
v29-0003-Limit-get_actual_variable_range-leaf-page-reads.patch application/octet-stream 7.6 KB
v29-0004-Adopt-amgetbatch-interface-in-hash-index-AM.patch application/octet-stream 47.9 KB
v29-0002-Add-amgetbatch-interface-and-adopt-it-in-nbtree.patch application/octet-stream 269.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2026-07-07 23:08:04 Re: Proposal: new file format for hba/ident/hosts configuration?
Previous Message Christoph Berg 2026-07-07 22:58:59 Re: WAL compression setting after PostgreSQL LZ4 default change