diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-01-20 18:55:07 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-01-20 18:55:07 +0000 |
| commit | bdfbfde1b168b3332c4cdac34ac86a80aaf4d442 (patch) | |
| tree | f35bf1af04733069f3a6b0a2698ac10dbd6544ed /src/backend/nodes/copyfuncs.c | |
| parent | be2b660ecd5ca205570825633e7b8479379ddc64 (diff) | |
| download | postgresql-bdfbfde1b168b3332c4cdac34ac86a80aaf4d442.tar.gz | |
IN clauses appearing at top level of WHERE can now be handled as joins.
There are two implementation techniques: the executor understands a new
JOIN_IN jointype, which emits at most one matching row per left-hand row,
or the result of the IN's sub-select can be fed through a DISTINCT filter
and then joined as an ordinary relation.
Along the way, some minor code cleanup in the optimizer; notably, break
out most of the jointree-rearrangement preprocessing in planner.c and
put it in a new file prep/prepjointree.c.
Diffstat (limited to 'src/backend/nodes/copyfuncs.c')
| -rw-r--r-- | src/backend/nodes/copyfuncs.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c index 8663c6c4a1..f8e81431ec 100644 --- a/src/backend/nodes/copyfuncs.c +++ b/src/backend/nodes/copyfuncs.c @@ -15,7 +15,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.236 2003/01/15 19:35:35 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.237 2003/01/20 18:54:46 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1095,6 +1095,21 @@ _copyJoinInfo(JoinInfo *from) return newnode; } +/* + * _copyInClauseInfo + */ +static InClauseInfo * +_copyInClauseInfo(InClauseInfo *from) +{ + InClauseInfo *newnode = makeNode(InClauseInfo); + + COPY_INTLIST_FIELD(lefthand); + COPY_INTLIST_FIELD(righthand); + COPY_NODE_FIELD(sub_targetlist); + + return newnode; +} + /* **************************************************************** * parsenodes.h copy functions * **************************************************************** @@ -1424,9 +1439,9 @@ _copyQuery(Query *from) /* * We do not copy the planner internal fields: base_rel_list, - * other_rel_list, join_rel_list, equi_key_list, query_pathkeys, - * hasJoinRTEs. That would get us into copying RelOptInfo/Path - * trees, which we don't want to do. + * other_rel_list, join_rel_list, equi_key_list, in_info_list, + * query_pathkeys, hasJoinRTEs. That would get us into copying + * RelOptInfo/Path trees, which we don't want to do. */ return newnode; @@ -2490,6 +2505,9 @@ copyObject(void *from) case T_JoinInfo: retval = _copyJoinInfo(from); break; + case T_InClauseInfo: + retval = _copyInClauseInfo(from); + break; /* * VALUE NODES |
