From 935969415a90065d4bc4b2643b4c9c50518c934b Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 30 Nov 2002 05:21:03 +0000 Subject: Be more realistic about plans involving Materialize nodes: take their cost into account while planning. --- src/backend/nodes/copyfuncs.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) (limited to 'src/backend/nodes/copyfuncs.c') diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c index 7798913cde5..d11b5ed201f 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.224 2002/11/30 00:08:16 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.225 2002/11/30 05:21:01 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1142,6 +1142,27 @@ _copyResultPath(ResultPath *from) return newnode; } +/* + * _copyMaterialPath + */ +static MaterialPath * +_copyMaterialPath(MaterialPath *from) +{ + MaterialPath *newnode = makeNode(MaterialPath); + + /* + * copy node superclass fields + */ + CopyPathFields((Path *) from, (Path *) newnode); + + /* + * copy remainder of node + */ + COPY_NODE_FIELD(subpath); + + return newnode; +} + /* * CopyJoinPathFields * @@ -2739,6 +2760,9 @@ copyObject(void *from) case T_RelOptInfo: retval = _copyRelOptInfo(from); break; + case T_IndexOptInfo: + retval = _copyIndexOptInfo(from); + break; case T_Path: retval = _copyPath(from); break; @@ -2754,6 +2778,9 @@ copyObject(void *from) case T_ResultPath: retval = _copyResultPath(from); break; + case T_MaterialPath: + retval = _copyMaterialPath(from); + break; case T_NestPath: retval = _copyNestPath(from); break; @@ -2772,9 +2799,6 @@ copyObject(void *from) case T_JoinInfo: retval = _copyJoinInfo(from); break; - case T_IndexOptInfo: - retval = _copyIndexOptInfo(from); - break; case T_InnerIndexscanInfo: retval = _copyInnerIndexscanInfo(from); break; -- cgit v1.2.3