mirror of
https://github.com/postgres/postgres.git
synced 2025-07-12 21:01:52 +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:
@ -15,7 +15,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.322 2005/11/26 22:14:56 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.323 2005/12/20 02:30:35 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -1277,6 +1277,22 @@ _copyRestrictInfo(RestrictInfo *from)
|
||||
return newnode;
|
||||
}
|
||||
|
||||
/*
|
||||
* _copyOuterJoinInfo
|
||||
*/
|
||||
static OuterJoinInfo *
|
||||
_copyOuterJoinInfo(OuterJoinInfo *from)
|
||||
{
|
||||
OuterJoinInfo *newnode = makeNode(OuterJoinInfo);
|
||||
|
||||
COPY_BITMAPSET_FIELD(min_lefthand);
|
||||
COPY_BITMAPSET_FIELD(min_righthand);
|
||||
COPY_SCALAR_FIELD(is_full_join);
|
||||
COPY_SCALAR_FIELD(lhs_strict);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
/*
|
||||
* _copyInClauseInfo
|
||||
*/
|
||||
@ -2906,6 +2922,9 @@ copyObject(void *from)
|
||||
case T_RestrictInfo:
|
||||
retval = _copyRestrictInfo(from);
|
||||
break;
|
||||
case T_OuterJoinInfo:
|
||||
retval = _copyOuterJoinInfo(from);
|
||||
break;
|
||||
case T_InClauseInfo:
|
||||
retval = _copyInClauseInfo(from);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user