pgsql: Add non-MVCC index scan test module.

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add non-MVCC index scan test module.
Date: 2026-09-03 21:37:15
Message-ID: E1x2F7S-00000003Mlv-1jg4@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add non-MVCC index scan test module.

Add test_indexscan, a new test module that provides an SQL-callable
function that performs a full index scan using whatever snapshot type
the caller asks for. Also add a set of tests that verify and document a
variety of behaviors associated with some specific snapshot type.

Preparation for an upcoming commit that will move index scan heap
fetches behind a new slot-based table AM interface. Aside from testing
non-MVCC snapshot types, these new tests can catch bugs where an index
scan incorrectly maintains xs_heap_continue during HOT chain traversal.
Such bugs are unlikely to affect MVCC scans, which makes it hard to
write tests that detect them without relying on a custom test module.

Author: Peter Geoghegan <pg(at)bowt(dot)ie>
Reviewed-by: Tomas Vondra <tomas(at)vondra(dot)me>
Discussion: https://postgr.es/m/CAH2-Wzn%2BC%3DmAMv9aW3Skfh80JPpHKT3yM%3DDYwkrrhYyG2f%2B_vg%40mail.gmail.com

Branch
------
master

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

Modified Files
--------------
src/test/modules/index/Makefile | 10 ++
src/test/modules/index/expected/hot_chain.out | 91 ++++++++++++++++
src/test/modules/index/meson.build | 26 +++++
src/test/modules/index/sql/hot_chain.sql | 47 ++++++++
src/test/modules/index/test_indexscan--1.0.sql | 13 +++
src/test/modules/index/test_indexscan.c | 143 +++++++++++++++++++++++++
src/test/modules/index/test_indexscan.control | 4 +
7 files changed, 334 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2026-09-03 22:54:12 pgsql: Minimize footprint of TOAST_MAX_CHUNK_SIZE in heap and amcheck c
Previous Message Nathan Bossart 2026-09-03 21:11:18 pgsql: Auto-vectorize the varbit bitwise operators.