mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +03:00
Simplify the planner's join clause management by storing join clauses
of a relation in a flat 'joininfo' list. The former arrangement grouped the join clauses according to the set of unjoined relids used in each; however, profiling on test cases involving lots of joins proves that that data structure is a net loss. It takes more time to group the join clauses together than is saved by avoiding duplicate tests later. It doesn't help any that there are usually not more than one or two clauses per group ...
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.305 2005/06/05 22:32:54 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.306 2005/06/09 04:18:58 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -1237,6 +1237,7 @@ _copyRestrictInfo(RestrictInfo *from)
|
||||
COPY_SCALAR_FIELD(valid_everywhere);
|
||||
COPY_SCALAR_FIELD(can_join);
|
||||
COPY_BITMAPSET_FIELD(clause_relids);
|
||||
COPY_BITMAPSET_FIELD(required_relids);
|
||||
COPY_BITMAPSET_FIELD(left_relids);
|
||||
COPY_BITMAPSET_FIELD(right_relids);
|
||||
COPY_NODE_FIELD(orclause);
|
||||
@ -1262,20 +1263,6 @@ _copyRestrictInfo(RestrictInfo *from)
|
||||
return newnode;
|
||||
}
|
||||
|
||||
/*
|
||||
* _copyJoinInfo
|
||||
*/
|
||||
static JoinInfo *
|
||||
_copyJoinInfo(JoinInfo *from)
|
||||
{
|
||||
JoinInfo *newnode = makeNode(JoinInfo);
|
||||
|
||||
COPY_BITMAPSET_FIELD(unjoined_relids);
|
||||
COPY_NODE_FIELD(jinfo_restrictinfo);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
/*
|
||||
* _copyInClauseInfo
|
||||
*/
|
||||
@ -2857,9 +2844,6 @@ copyObject(void *from)
|
||||
case T_RestrictInfo:
|
||||
retval = _copyRestrictInfo(from);
|
||||
break;
|
||||
case T_JoinInfo:
|
||||
retval = _copyJoinInfo(from);
|
||||
break;
|
||||
case T_InClauseInfo:
|
||||
retval = _copyInClauseInfo(from);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user