Re: Pulling up direct-correlated ANY_SUBLINK - Mailing list pgsql-hackers

Richard Guo <riguo@pivotal.io> writes:
> Currently we do not try to pull up sub-select of type ANY_SUBLINK if it
> refers to any Vars of the parent query, as indicated in the code snippet
> below:
>     if (contain_vars_of_level((Node *) subselect, 1))
>         return NULL;
> Why do we have this check?

Because the result would not be a join between two independent tables.

> Can we try to pull up direct-correlated ANY SubLink with the help of
> LATERAL?

Perhaps.  But what's the argument that you'd end up with a better
plan?  LATERAL pretty much constrains things to use a nestloop,
so I'm not sure there's anything fundamentally different.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: accounting for memory used for BufFile during hash joins
Next
From: Tom Lane
Date:
Subject: Re: [PATCH] Move user options to the end of the command in pg_upgrade