Skip to content

Commit 598b97d

Browse files
committed
Avoid a useless tuple copy within nodeMaterial. Neil Conway
1 parent deb5196 commit 598b97d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/backend/executor/nodeMaterial.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/nodeMaterial.c,v 1.61 2008/01/01 19:45:49 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/nodeMaterial.c,v 1.62 2008/03/23 00:54:04 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -124,18 +124,17 @@ ExecMaterial(MaterialState *node)
124124
}
125125

126126
/*
127-
* Append returned tuple to tuplestore. NOTE: because the tuplestore
128-
* is certainly in EOF state, its read position will move forward over
129-
* the added tuple. This is what we want.
127+
* Append a copy of the returned tuple to tuplestore. NOTE: because
128+
* the tuplestore is certainly in EOF state, its read position will
129+
* move forward over the added tuple. This is what we want.
130130
*/
131131
if (tuplestorestate)
132132
tuplestore_puttupleslot(tuplestorestate, outerslot);
133133

134134
/*
135-
* And return a copy of the tuple. (XXX couldn't we just return the
136-
* outerslot?)
135+
* We can just return the subplan's returned tuple, without copying.
137136
*/
138-
return ExecCopySlot(slot, outerslot);
137+
return outerslot;
139138
}
140139

141140
/*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy