提交 48437f5c 编写于 作者: T Tom Lane

Ensure that mergejoin plan will be considered for FULL OUTER JOIN even

if enable_mergejoin = OFF.  Must do this, because we have no other
implementation method for full joins.
上级 5479c11b
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.58 2000/10/05 19:48:26 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.59 2000/11/23 03:57:31 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -75,9 +75,12 @@ add_paths_to_joinrel(Query *root,
List *mergeclause_list = NIL;
/*
* Find potential mergejoin clauses.
* Find potential mergejoin clauses. We can skip this if we are not
* interested in doing a mergejoin. However, mergejoin is currently
* our only way of implementing full outer joins, so override
* mergejoin disable if it's a full join.
*/
if (enable_mergejoin)
if (enable_mergejoin || jointype == JOIN_FULL)
mergeclause_list = select_mergejoin_clauses(joinrel,
outerrel,
innerrel,
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.52 2000/11/16 22:30:25 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.53 2000/11/23 03:57:31 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -454,9 +454,13 @@ distribute_qual_to_rels(Query *root, Node *clause,
* joining.
*
* We don't bother setting the merge/hashjoin info if we're not
* going to need it.
* going to need it. We do want to know about mergejoinable ops
* in any potential equijoin clause (see later in this routine),
* and we ignore enable_mergejoin if isouterjoin is true, because
* mergejoin is the only implementation we have for full and right
* outer joins.
*/
if (enable_mergejoin || can_be_equijoin)
if (enable_mergejoin || isouterjoin || can_be_equijoin)
check_mergejoinable(restrictinfo);
if (enable_hashjoin)
check_hashjoinable(restrictinfo);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册