Re: BUG #17213: Wrong result from a query involving Merge Semi Join and Memoize

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Elvis Pranskevichus <elprans(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>, David Rowley <dgrowleyml(at)gmail(dot)com>
Subject: Re: BUG #17213: Wrong result from a query involving Merge Semi Join and Memoize
Date: 2021-10-05 01:21:21
Message-ID: 4022669.1633396881@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Elvis Pranskevichus <elprans(at)gmail(dot)com> writes:
> On Monday, October 4, 2021 5:14:47 PM PDT David Rowley wrote:
>>> It appears a combination of Merge Semi Join and Memoize in
>>> PostgreSQL 14 produces incorrect results on a particular query.

> It seems like a very particular set of stats is causing the plan there,
> as running ANALYZE turns the query into a Nested Loop Semi Join.

Surely this plan tree is broken on its face? The inner side of
a mergejoin has to be able to support mark/restore, and nestloop
doesn't (cf ExecSupportsMarkRestore, as well as assertions in
nodeNestloop). It looks to me like somebody removed an essential
plan-time check.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David Rowley 2021-10-05 01:59:40 Re: BUG #17213: Wrong result from a query involving Merge Semi Join and Memoize
Previous Message Peter Geoghegan 2021-10-05 01:19:54 Re: BUG #17212: pg_amcheck fails on checking temporary relations