On Tue, Dec 08, 2015 at 12:13:41PM -0500, Tom Lane wrote:
> Andreas Seltenreich <seltenreich@gmx.de> writes:
> >> I no longer see "failed to build any n-way joins" after pulling,
> >> but there are still instances of "could not devise a query plan".
> >> Samples below.
>
> > sorry, I spoke too soon: nine of the former have been logged
> > through the night. I'm attaching a larger set of sample queries
> > this time in case that there are still multiple causes for the
> > observed errors.
>
> Hm. At least in the first of these cases, the problem is that the
> code I committed yesterday doesn't account for indirect lateral
> dependencies. That is, if S1 depends on S2 which depends on the
> inner side of an outer join, it now knows not to join S2 directly to
> the outer side of the outer join, but it doesn't realize that the
> same must apply to S1.
>
> Maybe we should redefine lateral_relids as the transitive closure of
> a rel's lateral dependencies? Not sure.
That seems like it would fix the problem once and for good. Is there
any reason to believe that the lateral dependencies could go in a
loop, i.e. is there a reason to put in checks for same in the
transitive closure construction?
Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate