[PATCH] Add regression tests for btree skip scan support functions

From: Baji Shaik <baji(dot)pgdev(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: pg(at)bowt(dot)ie, michael(at)paquier(dot)xyz
Subject: [PATCH] Add regression tests for btree skip scan support functions
Date: 2026-06-04 00:16:15
Message-ID: CA+fm-RNqXnr_ms365xQnSMcggrGFozbEPrVa+Y_yGYrSky1o2w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

While looking at coverage for nbtcompare.c on coverage.postgresql.org,
I noticed several btree skip-scan support routines (the per-type
skipsupport / increment / decrement helpers) are not exercised by the
existing regression tests. Specifically:

oid8: btoid8skipsupport, oid8_decrement, oid8_increment
int8: btint8skipsupport, int8_decrement, int8_increment
bool: btboolskipsupport, bool_decrement, bool_increment
char: btcharskipsupport, char_decrement, char_increment
oid: oid_decrement
int2: int2_decrement

These functions feed into the skip-scan optimization added in
commit 92fe23d93aa for PG18, but the existing regression coverage
only exercises a few types (mostly int4 and varchar) on the leading
column of multi-column indexes.

The attached patch adds a small section to btree_index.sql that
creates a two-column index (a, b) for each missing type, then runs
forward and backward Index Only Scans with a predicate on the
non-leading column (b). This forces the planner into a skip scan,
which in turn calls the per-type skip-support function plus the
increment/decrement helpers as it generates skip-array elements.

No code change in this patch. It's regression coverage only.

Tested with make check (245/245 pass).

Thanks,
Baji Shaik

Attachment Content-Type Size
0001-Add-regression-tests-for-btree-skip-scan-support-fun.patch application/octet-stream 10.9 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2026-06-04 00:25:51 Re: generic plans and "initial" pruning
Previous Message Diego Frias 2026-06-04 00:06:09 Interest in Faster Unicode Normalization