diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-12-12 15:49:42 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-12-12 15:49:42 +0000 |
commit | a0bf885f9eaccadd23b766ecbc064f17f06ae883 (patch) | |
tree | 62b65e5cf1a8ec02ece3a98c15457ddff018bb94 /src/backend/optimizer/util/var.c | |
parent | debb072886efcb15e7f0825e35b168afe316d37d (diff) | |
download | postgresql-a0bf885f9eaccadd23b766ecbc064f17f06ae883.tar.gz postgresql-a0bf885f9eaccadd23b766ecbc064f17f06ae883.zip |
Phase 2 of read-only-plans project: restructure expression-tree nodes
so that all executable expression nodes inherit from a common supertype
Expr. This is somewhat of an exercise in code purity rather than any
real functional advance, but getting rid of the extra Oper or Func node
formerly used in each operator or function call should provide at least
a little space and speed improvement.
initdb forced by changes in stored-rules representation.
Diffstat (limited to 'src/backend/optimizer/util/var.c')
-rw-r--r-- | src/backend/optimizer/util/var.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/backend/optimizer/util/var.c b/src/backend/optimizer/util/var.c index 23b824dbcb0..8d22aa26b91 100644 --- a/src/backend/optimizer/util/var.c +++ b/src/backend/optimizer/util/var.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/util/var.c,v 1.40 2002/09/11 14:48:54 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/util/var.c,v 1.41 2002/12/12 15:49:33 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -65,7 +65,7 @@ static Node *flatten_join_alias_vars_mutator(Node *node, * NOTE: this is used on not-yet-planned expressions. It may therefore find * bare SubLinks, and if so it needs to recurse into them to look for uplevel * references to the desired rtable level! But when we find a completed - * SubPlan, we only need to look at the parameters passed to the subplan. + * SubPlanExpr, we only need to look at the parameters passed to the subplan. */ List * pull_varnos(Node *node) @@ -111,12 +111,12 @@ pull_varnos_walker(Node *node, pull_varnos_context *context) * executed by the outer query. But short-circuit recursion into * the subquery itself, which would be a waste of effort. */ - Expr *expr = (Expr *) node; + SubPlanExpr *subplan = (SubPlanExpr *) node; - if (pull_varnos_walker((Node *) ((SubPlan *) expr->oper)->sublink->oper, + if (pull_varnos_walker((Node *) subplan->sublink->oper, context)) return true; - if (pull_varnos_walker((Node *) expr->args, + if (pull_varnos_walker((Node *) subplan->args, context)) return true; return false; @@ -146,7 +146,7 @@ pull_varnos_walker(Node *node, pull_varnos_context *context) * NOTE: this is used on not-yet-planned expressions. It may therefore find * bare SubLinks, and if so it needs to recurse into them to look for uplevel * references to the desired rtable entry! But when we find a completed - * SubPlan, we only need to look at the parameters passed to the subplan. + * SubPlanExpr, we only need to look at the parameters passed to the subplan. */ bool contain_var_reference(Node *node, int varno, int varattno, int levelsup) @@ -194,12 +194,12 @@ contain_var_reference_walker(Node *node, * executed by the outer query. But short-circuit recursion into * the subquery itself, which would be a waste of effort. */ - Expr *expr = (Expr *) node; + SubPlanExpr *subplan = (SubPlanExpr *) node; - if (contain_var_reference_walker((Node *) ((SubPlan *) expr->oper)->sublink->oper, + if (contain_var_reference_walker((Node *) subplan->sublink->oper, context)) return true; - if (contain_var_reference_walker((Node *) expr->args, + if (contain_var_reference_walker((Node *) subplan->args, context)) return true; return false; |