Commit 57ea2084 authored by Tom Lane's avatar Tom Lane

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.
parent e2a29eb5
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.57 1999/08/22 20:14:48 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.58 1999/10/30 23:07:55 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -110,8 +110,13 @@ set_plan_references(Plan *plan) ...@@ -110,8 +110,13 @@ set_plan_references(Plan *plan)
set_uppernode_references(plan, (Index) 0); set_uppernode_references(plan, (Index) 0);
break; break;
case T_Result: case T_Result:
/* XXX why does Result use a different subvarno? */ /* Result may or may not have a subplan; no need to fix up
set_uppernode_references(plan, (Index) OUTER); * subplan references if it hasn't got one...
*
* XXX why does Result use a different subvarno from Agg/Group?
*/
if (plan->lefttree != NULL)
set_uppernode_references(plan, (Index) OUTER);
fix_opids(((Result *) plan)->resconstantqual); fix_opids(((Result *) plan)->resconstantqual);
break; break;
case T_Append: case T_Append:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment