aboutsummaryrefslogtreecommitdiff
path: root/src/backend/nodes/equalfuncs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-11-12 00:37:02 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-11-12 00:37:02 +0000
commit6543d81d659f4176c6530fb09eef83deede264a0 (patch)
treec1dd2a57ee5e640214978ae72e8e7b2f624f8972 /src/backend/nodes/equalfuncs.c
parent609f9199af2411a52bb9731d8aa1f13885c439b5 (diff)
downloadpostgresql-6543d81d659f4176c6530fb09eef83deede264a0.tar.gz
postgresql-6543d81d659f4176c6530fb09eef83deede264a0.zip
Restructure handling of inheritance queries so that they work with outer
joins, and clean things up a good deal at the same time. Append plan node no longer hacks on rangetable at runtime --- instead, all child tables are given their own RT entries during planning. Concept of multiple target tables pushed up into execMain, replacing bug-prone implementation within nodeAppend. Planner now supports generating Append plans for inheritance sets either at the top of the plan (the old way) or at the bottom. Expanding at the bottom is appropriate for tables used as sources, since they may appear inside an outer join; but we must still expand at the top when the target of an UPDATE or DELETE is an inheritance set, because we actually need a different targetlist and junkfilter for each target table in that case. Fortunately a target table can't be inside an outer join... Bizarre mutual recursion between union_planner and prepunion.c is gone --- in fact, union_planner doesn't really have much to do with union queries anymore, so I renamed it grouping_planner.
Diffstat (limited to 'src/backend/nodes/equalfuncs.c')
-rw-r--r--src/backend/nodes/equalfuncs.c43
1 files changed, 16 insertions, 27 deletions
diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c
index 7ed95db9679..8fb81a45c0b 100644
--- a/src/backend/nodes/equalfuncs.c
+++ b/src/backend/nodes/equalfuncs.c
@@ -20,7 +20,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.80 2000/11/05 22:50:19 vadim Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.81 2000/11/12 00:36:57 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -436,6 +436,16 @@ _equalTidPath(TidPath *a, TidPath *b)
}
static bool
+_equalAppendPath(AppendPath *a, AppendPath *b)
+{
+ if (!_equalPath((Path *) a, (Path *) b))
+ return false;
+ if (!equal(a->subpaths, b->subpaths))
+ return false;
+ return true;
+}
+
+static bool
_equalJoinPath(JoinPath *a, JoinPath *b)
{
if (!_equalPath((Path *) a, (Path *) b))
@@ -556,28 +566,6 @@ _equalStream(Stream *a, Stream *b)
}
/*
- * Stuff from execnodes.h
- */
-
-/*
- * EState is a subclass of Node.
- */
-static bool
-_equalEState(EState *a, EState *b)
-{
- if (a->es_direction != b->es_direction)
- return false;
-
- if (!equal(a->es_range_table, b->es_range_table))
- return false;
-
- if (a->es_result_relation_info != b->es_result_relation_info)
- return false;
-
- return true;
-}
-
-/*
* Stuff from parsenodes.h
*/
@@ -624,6 +612,8 @@ _equalQuery(Query *a, Query *b)
return false;
if (!equal(a->setOperations, b->setOperations))
return false;
+ if (!equali(a->resultRelations, b->resultRelations))
+ return false;
/*
* We do not check the internal-to-the-planner fields: base_rel_list,
@@ -1851,14 +1841,13 @@ equal(void *a, void *b)
case T_TidPath:
retval = _equalTidPath(a, b);
break;
+ case T_AppendPath:
+ retval = _equalAppendPath(a, b);
+ break;
case T_IndexOptInfo:
retval = _equalIndexOptInfo(a, b);
break;
- case T_EState:
- retval = _equalEState(a, b);
- break;
-
case T_List:
{
List *la = (List *) a;