mirror of
https://github.com/postgres/postgres.git
synced 2025-11-12 05:01:15 +03:00
Teach planner how to rearrange join order for some classes of OUTER JOIN.
Per my recent proposal. I ended up basing the implementation on the existing mechanism for enforcing valid join orders of IN joins --- the rules for valid outer-join orders are somewhat similar.
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.258 2005/11/22 18:17:11 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.259 2005/12/20 02:30:35 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -613,6 +613,17 @@ _equalRestrictInfo(RestrictInfo *a, RestrictInfo *b)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
_equalOuterJoinInfo(OuterJoinInfo *a, OuterJoinInfo *b)
|
||||
{
|
||||
COMPARE_BITMAPSET_FIELD(min_lefthand);
|
||||
COMPARE_BITMAPSET_FIELD(min_righthand);
|
||||
COMPARE_SCALAR_FIELD(is_full_join);
|
||||
COMPARE_SCALAR_FIELD(lhs_strict);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
_equalInClauseInfo(InClauseInfo *a, InClauseInfo *b)
|
||||
{
|
||||
@@ -1954,6 +1965,9 @@ equal(void *a, void *b)
|
||||
case T_RestrictInfo:
|
||||
retval = _equalRestrictInfo(a, b);
|
||||
break;
|
||||
case T_OuterJoinInfo:
|
||||
retval = _equalOuterJoinInfo(a, b);
|
||||
break;
|
||||
case T_InClauseInfo:
|
||||
retval = _equalInClauseInfo(a, b);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user