Re: LATERAL - Mailing list pgsql-hackers

From Tom Lane
Subject Re: LATERAL
Date
Msg-id 12171.1253676117@sss.pgh.pa.us
Whole thread Raw
In response to Re: LATERAL  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: LATERAL
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> I've been turning this one over in my head.  It seems to me that this
> is very similar to what we already do with inner index-scans, only
> generalized to joinrels.

Right.

> Currently, however, we only consider this possibility when the inner
> rel is NOT a joinrel.  It seems like it might be possible to change
> this, but it doesn't look straightforward.

Well, it's straightforward enough in theory, it's just the exponential
growth in the number of join paths to consider that's a problem :-(.
I think what we'd need is a heuristic to limit the paths considered.

I think Andrew was suggesting that we not attempt to consider this
automatically, but only when the user writes the query in a way that
exposes it directly via LATERAL.  While that goes against my normal
instincts for the planner, it isn't unreasonable as a first step.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: LATERAL
Next
From: Petr Jelinek
Date:
Subject: Re: Anonymous code blocks