From: Tom Lane Date: Sun, 5 Apr 2009 20:32:06 +0000 (+0000) Subject: Make ExecInitExpr build the list of SubPlans found in a plan tree in order X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=dd03ba9fcaa5d04b28148e2ed6fb533fe1f71433;p=users%2Fsimon%2Fpostgres.git Make ExecInitExpr build the list of SubPlans found in a plan tree in order of discovery, rather than reverse order. This doesn't matter functionally (I suppose the previous coding dates from the time when lcons was markedly cheaper than lappend). However now that EXPLAIN is labeling subplans with IDs that are based on order of creation, this may help produce a slightly less surprising printout. --- diff --git a/src/backend/executor/execQual.c b/src/backend/executor/execQual.c index 8ec92c4ccc..1fac16212a 100644 --- a/src/backend/executor/execQual.c +++ b/src/backend/executor/execQual.c @@ -4326,7 +4326,7 @@ ExecInitExpr(Expr *node, PlanState *parent) sstate = ExecInitSubPlan(subplan, parent); /* Add SubPlanState nodes to parent->subPlan */ - parent->subPlan = lcons(sstate, parent->subPlan); + parent->subPlan = lappend(parent->subPlan, sstate); state = (ExprState *) sstate; }