Do we need to pass down nonnullable_vars when reducing outer joins?

Started by Richard Guoover 3 years ago3 messageshackers
Jump to latest
#1Richard Guo
guofenglinux@gmail.com

AFAICS, the Vars forced nonnullable by given clause are only used to
check if we can reduce JOIN_LEFT to JOIN_ANTI, and it is checking the
join's own quals there. It seems to me we do not need to pass down
nonnullable_vars by upper quals to the children of a join.

Attached is a patch to remove the pass-down of nonnullable_vars.

Thanks
Richard

Attachments:

v1-0001-Don-t-pass-down-nonnullable_vars-when-reducing-ou.patchapplication/octet-stream; name=v1-0001-Don-t-pass-down-nonnullable_vars-when-reducing-ou.patchDownload+2-25
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Richard Guo (#1)
Re: Do we need to pass down nonnullable_vars when reducing outer joins?

Richard Guo <guofenglinux@gmail.com> writes:

AFAICS, the Vars forced nonnullable by given clause are only used to
check if we can reduce JOIN_LEFT to JOIN_ANTI, and it is checking the
join's own quals there. It seems to me we do not need to pass down
nonnullable_vars by upper quals to the children of a join.

Hmm, you are right, we are not doing anything useful with that data.
I can't remember if I had a concrete plan for doing something with it
or not, but we sure aren't using it now. So pushed.

regards, tom lane

#3Richard Guo
guofenglinux@gmail.com
In reply to: Tom Lane (#2)
Re: Do we need to pass down nonnullable_vars when reducing outer joins?

On Sun, Nov 6, 2022 at 4:00 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:

Richard Guo <guofenglinux@gmail.com> writes:

AFAICS, the Vars forced nonnullable by given clause are only used to
check if we can reduce JOIN_LEFT to JOIN_ANTI, and it is checking the
join's own quals there. It seems to me we do not need to pass down
nonnullable_vars by upper quals to the children of a join.

Hmm, you are right, we are not doing anything useful with that data.
I can't remember if I had a concrete plan for doing something with it
or not, but we sure aren't using it now. So pushed.

Thanks for pushing it!

Thanks
Richard