mirror of
https://github.com/postgres/postgres.git
synced 2025-06-29 10:41:53 +03:00
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.
This commit is contained in:
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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;
|
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,
|
mergeclause_list = select_mergejoin_clauses(joinrel,
|
||||||
outerrel,
|
outerrel,
|
||||||
innerrel,
|
innerrel,
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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.
|
* joining.
|
||||||
*
|
*
|
||||||
* We don't bother setting the merge/hashjoin info if we're not
|
* 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);
|
check_mergejoinable(restrictinfo);
|
||||||
if (enable_hashjoin)
|
if (enable_hashjoin)
|
||||||
check_hashjoinable(restrictinfo);
|
check_hashjoinable(restrictinfo);
|
||||||
|
Reference in New Issue
Block a user