On Mon, Oct 10, 2022 at 10:35 AM Richard Guo <guofengli...@gmail.com> wrote:

> As we know when we pull up a simple subquery, if the subquery is within
> the nullable side of an outer join, lateral references to non-nullable
> items may have to be turned into PlaceHolderVars. I happened to wonder
> what should we do about the PHVs if the outer join is reduced to inner
> join afterwards. Should we unwrap the related PHVs? I'm asking because
> PHVs may imply lateral dependencies which may make us have to use
> nestloop join.
>

At first I considered about unwrapping the related PHVs after we've
successfully reduced outer joins to inner joins. But that requires a lot
of coding which seems not worth the trouble.

I think maybe the problem here is about the order we pull up subqueries
and we reduce outer joins. But simply flipping the order for them two is
definitely incorrect. I'm not sure how to make it right.

Any thoughts?

Thanks
Richard

Reply via email to