From 77387f0ac859c099c6ab669db1e7a852524696c4 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 30 Aug 2012 14:32:22 -0400 Subject: Suppress creation of backwardly-indexed paths for LATERAL join clauses. Given a query such as SELECT * FROM foo JOIN LATERAL (SELECT foo.var1) ss(x) ON ss.x = foo.var2 the existence of the join clause "ss.x = foo.var2" encourages indxpath.c to build a parameterized path for foo using any index available for foo.var2. This is completely useless activity, though, since foo has got to be on the outside not the inside of any nestloop join with ss. It's reasonably inexpensive to add tests that prevent creation of such paths, so let's do that. --- src/include/optimizer/paths.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/include/optimizer/paths.h') diff --git a/src/include/optimizer/paths.h b/src/include/optimizer/paths.h index b6fb8ee5ce9..165856de0bc 100644 --- a/src/include/optimizer/paths.h +++ b/src/include/optimizer/paths.h @@ -127,7 +127,8 @@ extern void mutate_eclass_expressions(PlannerInfo *root, void *context); extern List *generate_implied_equalities_for_indexcol(PlannerInfo *root, IndexOptInfo *index, - int indexcol); + int indexcol, + Relids prohibited_rels); extern bool have_relevant_eclass_joinclause(PlannerInfo *root, RelOptInfo *rel1, RelOptInfo *rel2); extern bool has_relevant_eclass_joinclause(PlannerInfo *root, -- cgit v1.2.3