Re: Using each rel as both outer and inner for JOIN_ANTI

Richard Guo <guofenglinux@gmail.com>

From: Richard Guo <guofenglinux@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Ronan Dunklau <ronan.dunklau@aiven.io>, Pg Hackers <pgsql-hackers@lists.postgresql.org>, Emre Hasegeli <emre@hasegeli.com>
Date: 2022-08-09T08:12:08Z
Lists: pgsql-hackers

Attachments

On Tue, Aug 2, 2022 at 3:13 PM Richard Guo <guofenglinux@gmail.com> wrote:

> On Sun, Jul 31, 2022 at 12:07 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
>> I took a quick look through this.  The executor changes are indeed
>> impressively short, but that's largely because you've paid zero
>> attention to updating obsoleted comments.  For example, in
>> nodeHashjoin.c there are lots of references to right/full joins
>> that likely now need to cover right-anti.  I'm not sure that the
>> empty-rel startup optimizations are correct for this case, either.
>
>
> Thanks for the review! Yeah, you're right. I neglected to update the
> related comments. Will do that in the new patch. For the empty-rel
> startup optimizations, since the right-anti join also does null-fill on
> inner relation (the HJ_FILL_INNER case), I think we cannot skip building
> the hash table even when the outer rel is completely empty.
>

Here is the new patch which addresses the obsoleted comments.

Thanks
Richard

Commits

  1. Support "Right Anti Join" plan shapes.