From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Dimitri Nüscheler <dimitri(dot)nuescheler(at)gmail(dot)com> |
Cc: | pgsql-bugs(at)lists(dot)postgresql(dot)org, Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com> |
Subject: | Re: BUG #16865: Regression: GIN Negated prefix search returns results that contain the search term |
Date: | 2021-02-15 23:26:48 |
Message-ID: | 2288864.1613431608@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
=?UTF-8?Q?Dimitri_N=C3=BCscheler?= <dimitri(dot)nuescheler(at)gmail(dot)com> writes:
> Meanwhile I managed to anonymize the data. I put it in this archive
> https://www.violetsky.ch/postgres-issue-anonymized.tar.gz
Thanks. I've reproduced the issue and it boils down to doing the
wrong thing when there are GIN_MAYBE values in the input data for
checkcondition_gin, specifically when the bitmap holding the original
GIN index results has become lossy. We correctly get a TS_MAYBE
result out of the calculation in TS_execute_recurse, but then
TS_execute figures it can throw that detail away and just return
TS_YES. I think that this problem existed before 2f2007fbb, but
we were masking it by always forcing rechecks.
Anyway, this seems to put the final nail in the coffin of the idea
that it's sufficient for TS_execute to return a boolean. At least
the tsginidx.c callers really need to see the 3-way result. Hence
I propose the attached patch. It fixes the given test case, but
I wonder if you can try it and see if you see any remaining problems.
I wasted quite a bit of time trying to devise a test case that is
short enough to be reasonable to include in our regression tests,
without success ... you need quite a bit of data to make the GIN
bitmap become lossy. So no test case here, but I'm not super
comfortable with that.
regards, tom lane
Attachment | Content-Type | Size |
---|---|---|
fix-lossy-gin-index-behavior.patch | text/x-diff | 2.7 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | PG Bug reporting form | 2021-02-15 23:57:23 | BUG #16868: Cannot find sqlstat error codes. |
Previous Message | Arthur Nascimento | 2021-02-15 21:47:29 | Re: BUG #16867: savepoints vs. commit and chain |