pgsql: Make IndexScanInstrumentation a pointer in executor scan nodes.

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Make IndexScanInstrumentation a pointer in executor scan nodes.
Date: 2026-03-22 17:20:51
Message-ID: E1w4MTq-000xr2-2i@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Make IndexScanInstrumentation a pointer in executor scan nodes.

Change the IndexScanInstrumentation fields in IndexScanState,
IndexOnlyScanState, and BitmapIndexScanState from inline structs to
pointers. This avoids additional space overhead whenever new fields are
added to IndexScanInstrumentation in the future, at least in the common
case where the instrumentation isn't used (i.e. when the executor node
isn't being run through an EXPLAIN ANALYZE).

Preparation for an upcoming patch series that will add index
prefetching. The new slot-based interface that will enable index
prefetching necessitates that we add at least one more field to
IndexScanInstrumentation (to count heap fetches during index-only
scans).

Author: Peter Geoghegan <pg(at)bowt(dot)ie>
Reviewed-By: Andres Freund <andres(at)anarazel(dot)de>
Discussion: https://postgr.es/m/CAH2-Wz=g=JTSyDB4UtB5su2ZcvsS7VbP+ZMvvaG6ABoCb+s8Lw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f026fbf059f2d9d7c8f1f52e9210018d38d795d8

Modified Files
--------------
src/backend/commands/explain.c | 6 +++---
src/backend/executor/nodeBitmapIndexscan.c | 8 ++++++--
src/backend/executor/nodeIndexonlyscan.c | 12 ++++++++----
src/backend/executor/nodeIndexscan.c | 14 +++++++++-----
src/include/nodes/execnodes.h | 6 +++---
5 files changed, 29 insertions(+), 17 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Melanie Plageman 2026-03-22 19:48:09 pgsql: Add pruning fast path for all-visible and all-frozen pages
Previous Message Melanie Plageman 2026-03-22 15:55:45 pgsql: Detect and fix visibility map corruption in more cases