Skip to content

Commit 57ea208

Browse files
committed
Skip invoking set_uppernode_references() for a RESULT node
that has no subplan --- saves a material amount of time for a simple INSERT ... VALUES query.
1 parent e2a29eb commit 57ea208

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/backend/optimizer/plan/setrefs.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.57 1999/08/22 20:14:48 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.58 1999/10/30 23:07:55 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -110,8 +110,13 @@ set_plan_references(Plan *plan)
110110
set_uppernode_references(plan, (Index) 0);
111111
break;
112112
case T_Result:
113-
/* XXX why does Result use a different subvarno? */
114-
set_uppernode_references(plan, (Index) OUTER);
113+
/* Result may or may not have a subplan; no need to fix up
114+
* subplan references if it hasn't got one...
115+
*
116+
* XXX why does Result use a different subvarno from Agg/Group?
117+
*/
118+
if (plan->lefttree != NULL)
119+
set_uppernode_references(plan, (Index) OUTER);
115120
fix_opids(((Result *) plan)->resconstantqual);
116121
break;
117122
case T_Append:

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