From: John Burns <john@impactdatametrics.com>
To: Tomas Vondra <tomas.vondra@enterprisedb.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: Index plan returns different results to sequential scan
Date: Fri, 22 Mar 2024 06:42:42 +0100
Message-ID: <3D84D157-24B4-447E-AA77-B80DF8543378@impactdatametrics.com> (raw)
In-Reply-To: <27496161-e7ec-47bd-b559-3571fde4dcb4@enterprisedb.com>
References: <3B86F188-F4BF-4331-AD79-E5FF2D0711A3@impactdatametrics.com>
<72600f8a-4231-45b7-a116-8ceec5ccf66e@enterprisedb.com>
<881DF028-5222-486C-A13B-451239C1316F@impactdatametrics.com>
<27496161-e7ec-47bd-b559-3571fde4dcb4@enterprisedb.com>
I’m sorry, but I can’t really say when it broke — we suspect when we went from version 14 to 16 — we use this functionality a lot, and we would have noticed long ago if it was wrong.
As additional information, I created a new operator that used another function — wrapping the function postcode_cmp_partial(...) = 0 — and it exhibited the same behaviour.
Not surprised since the postcode_eq_partial is a trivially simple function.
— John Burns
> On 22 Mar 2024, at 00:58, Tomas Vondra <tomas.vondra@enterprisedb.com> wrote:
>
>
>
> On 3/21/24 21:08, John Burns wrote:
>>
>>
>>> On 21 Mar 2024, at 20:27, Tomas Vondra <tomas.vondra@enterprisedb.com> wrote:
>>>
>>>
>>> Sorry about that … the patched version of the package, plus a sample data set is in the attached zip file,
>>>
>>> -John
>>>
>
> Thanks, I can reproduce the issue. I don't know why is it happening, but
> the behavior I see is that the (postcode % 'NW10') query somehow misses
> rows with postcodes 'NW10 0AA' - 'NW10 3NL' when executed using index.
>
> I don't see anything obviously wrong in the extension / index pages.
>
> You suggested it used to work OK and then broke. Do you perhaps know at
> which version it broke? Or did you use 9.x until now, upgrades to 16 and
> realized it's broken?
>
>
> regards
>
> --
> Tomas Vondra
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: john@impactdatametrics.com, tomas.vondra@enterprisedb.com
Subject: Re: Index plan returns different results to sequential scan
In-Reply-To: <3D84D157-24B4-447E-AA77-B80DF8543378@impactdatametrics.com>
References: <3B86F188-F4BF-4331-AD79-E5FF2D0711A3@impactdatametrics.com> <72600f8a-4231-45b7-a116-8ceec5ccf66e@enterprisedb.com> <881DF028-5222-486C-A13B-451239C1316F@impactdatametrics.com> <27496161-e7ec-47bd-b559-3571fde4dcb4@enterprisedb.com> <3D84D157-24B4-447E-AA77-B80DF8543378@impactdatametrics.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox