Re: Anti join confusion

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: wenhui qiu <qiuwenhuifx(at)gmail(dot)com>
Cc: Richard Guo <guofenglinux(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Anti join confusion
Date: 2025-02-24 03:26:25
Message-ID: 1241615.1740367585@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

wenhui qiu <qiuwenhuifx(at)gmail(dot)com> writes:
> I found this path https://commitfest.postgresql.org/patch/3235/ already
> supports anti join , But I've found that in many cases it doesn't work.It
> always uses SubPlan Here's my testing process.

NOT IN is not convertible to an anti-join: the semantics are wrong
because of the way it treats nulls in the sub-select's output.

In principle you could do it if you could prove that the sub-select's
output is never null, but we need to do this transformation long
before we have enough information to make such a deduction.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Brazeal 2025-02-24 03:31:01 Experimental tool to explore commitfest patches
Previous Message Tender Wang 2025-02-24 03:24:35 Re: Anti join confusion