Re: BUG #18522: Wrong results with Merge Right Anti Join, inconsistent with Merge Anti Join - Mailing list pgsql-bugs

From Antti Lampinen
Subject Re: BUG #18522: Wrong results with Merge Right Anti Join, inconsistent with Merge Anti Join
Date
Msg-id CAA9nBeiJo1sok77L38Amojt8wP5HqsJYDH-zGNwGggmPdxiY7w@mail.gmail.com
Whole thread Raw
In response to Re: BUG #18522: Wrong results with Merge Right Anti Join, inconsistent with Merge Anti Join  (Richard Guo <guofenglinux@gmail.com>)
Responses Re: BUG #18522: Wrong results with Merge Right Anti Join, inconsistent with Merge Anti Join
List pgsql-bugs
On Tue, Jun 25, 2024 at 5:07 AM Richard Guo <guofenglinux@gmail.com> wrote:
>
> On Tue, Jun 25, 2024 at 2:37 AM PG Bug reporting form
> <noreply@postgresql.org> wrote:
> > The following two queries result in different query plans and different
> > results, even though there is only a dummy condition change between them.
> > The
> > latter results are correct, there are two rows that match the conditions.
>
> Could you please provide the schema and necessary data for the two
> tables to reproduce this bug?  If there is a self-contained repro, that
> would be great.

I managed to create a self-contained repro:
https://gist.github.com/arlampin/0b86963694a936147383f3af3c83224c

This gives me consistently different results based on superfluous condition
change. See the two EXPLAIN queries in the sample.

Thanks,
Antti



pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: error "can only drop stats once" brings down database
Next
From: Amit Kapila
Date:
Subject: Re: Potential data loss due to race condition during logical replication slot creation