[PATCH] Add regression tests for btree skip scan support functions - Mailing list pgsql-hackers

From Baji Shaik
Subject [PATCH] Add regression tests for btree skip scan support functions
Date
Msg-id CA+fm-RNqXnr_ms365xQnSMcggrGFozbEPrVa+Y_yGYrSky1o2w@mail.gmail.com
Whole thread
Responses Re: [PATCH] Add regression tests for btree skip scan support functions
List 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

pgsql-hackers by date:

Previous
From: Diego Frias
Date:
Subject: Interest in Faster Unicode Normalization
Next
From: "彭冲"
Date:
Subject: Re: First draft of PG 19 release notes