1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-15 19:21:59 +03:00

Fix a bug in the original implementation of redundant-join-clause removal:

clauses in which one side or the other references both sides of the join
cannot be removed as redundant, because that expression won't have been
constrained below the join.  Per report from Sergey Burladyan.
This commit is contained in:
Tom Lane
2007-07-31 19:53:50 +00:00
parent 5bd7b83426
commit 1be62b532b
8 changed files with 95 additions and 9 deletions

View File

@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/plan/createplan.c,v 1.217 2006/10/04 00:29:54 momjian Exp $
* $PostgreSQL: pgsql/src/backend/optimizer/plan/createplan.c,v 1.217.2.1 2007/07/31 19:53:49 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -1398,7 +1398,9 @@ create_nestloop_plan(PlannerInfo *root,
select_nonredundant_join_clauses(root,
joinrestrictclauses,
innerpath->indexclauses,
IS_OUTER_JOIN(best_path->jointype));
best_path->outerjoinpath->parent->relids,
best_path->innerjoinpath->parent->relids,
IS_OUTER_JOIN(best_path->jointype));
}
}
else if (IsA(best_path->innerjoinpath, BitmapHeapPath))
@ -1430,7 +1432,9 @@ create_nestloop_plan(PlannerInfo *root,
select_nonredundant_join_clauses(root,
joinrestrictclauses,
bitmapclauses,
IS_OUTER_JOIN(best_path->jointype));
best_path->outerjoinpath->parent->relids,
best_path->innerjoinpath->parent->relids,
IS_OUTER_JOIN(best_path->jointype));
}
}