Re: BUG #19964: ltree GiST index returns too few rows for lquery with a {0,n} quantifier

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Aman Ganapathy <aman(at)stack-auth(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19964: ltree GiST index returns too few rows for lquery with a {0,n} quantifier
Date: 2026-12-02 22:39:41
Message-ID: 2025612.1796251181@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Aman Ganapathy <aman(at)stack-auth(dot)com> writes:
> I realized I forgot to attach my suggested patch and regression test. When
> a GiST search on ltree reaches an internal page, gist_qe() skips the
> subtree unless every label in the lquery is in the page's signature. That's
> wrong for a level like c{0,1}: rows like x_y.b match without containing c,
> so their subtrees get skipped.

Pushed, after shortening the test additions a great deal. Expending
lots and lots of cycles to test an edge case is not a win, and in
this test script we already have a perfectly good test table to use.

Thanks for the report and patch!

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Zsolt Parragi 2026-12-02 22:41:07 Re: BUG #19872: JSON_TABLE: an UNUSED PASSING argument's COLLATE leaks into the output columns (wrong results, persi
Previous Message Nathan Bossart 2026-12-02 22:36:49 Re: JSON_SERIALIZE for JSONB returns parts of the internal JSONB representation