GiST multirange index scans can fail to return rows - Mailing list pgsql-hackers

From Peter Geoghegan
Subject GiST multirange index scans can fail to return rows
Date
Msg-id CAH2-Wzm1GpQ9qixP=Xs2TYdfnLM88OZ=yUFHNuajS_W7U90-tQ@mail.gmail.com
Whole thread
Responses Re: Fix race in ReplicationSlotRelease for ephemeral slots
List pgsql-hackers
The attached regression test patch (written by Claude Code) shows that
a GiST index on a multirange column can fail to return rows during
scans that use the contained-by operator.

The multirangetypes test already runs every GiST query twice, once
with a sequential scan and once with the index, and the two must
agree. The added query asks for rows contained in
'{[1,11),[21,31),[41,51)}', which is a value the test table already
contains. The sequential scan returns 501 and the index scan returns
500. The row it loses has a multirange that exactly matches the one
from the query.

The multirange GiST support was added by db6335b5b. This is an issue
on 14 and up.

-- 
Peter Geoghegan

Attachment

pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Fix "unexpected logical decoding status change" error; from concurrent logical decoding activation
Next
From: Scott Ray
Date:
Subject: Re: Recovery conflict resolution misses backends that import snapshots