Andrei Lepikhov <lepihov@gmail.com> writes:
> Pardon the noise, but I'm curious why the optimiser must choose NestLoop
> in the case of lateral reference.
To pass down the current outer row's value of the lateral reference.
> It would be nice to provide alternatives. Because now we have some
> corner cases.
That's a fairly bizarre case, and I'm not at all convinced that
the old plan was correct.
regards, tom lane