aboutsummaryrefslogtreecommitdiff
path: root/src/backend/nodes/makefuncs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>1999-08-22 20:15:04 +0000
committerTom Lane <tgl@sss.pgh.pa.us>1999-08-22 20:15:04 +0000
commit78114cd4d4fd99feb0c753de34d358b16d1ff0ee (patch)
tree58838858badf427beddaafe425a9def510741d37 /src/backend/nodes/makefuncs.c
parentdb436adf761bd5cb7990745ceba2959ac4bfca7c (diff)
downloadpostgresql-78114cd4d4fd99feb0c753de34d358b16d1ff0ee.tar.gz
postgresql-78114cd4d4fd99feb0c753de34d358b16d1ff0ee.zip
Further planner/optimizer cleanups. Move all set_tlist_references
and fix_opids processing to a single recursive pass over the plan tree executed at the very tail end of planning, rather than haphazardly here and there at different places. Now that tlist Vars do not get modified until the very end, it's possible to get rid of the klugy var_equal and match_varid partial-matching routines, and just use plain equal() throughout the optimizer. This is a step towards allowing merge and hash joins to be done on expressions instead of only Vars ...
Diffstat (limited to 'src/backend/nodes/makefuncs.c')
-rw-r--r--src/backend/nodes/makefuncs.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/backend/nodes/makefuncs.c b/src/backend/nodes/makefuncs.c
index 26ebed1d458..ddfef9d5eb4 100644
--- a/src/backend/nodes/makefuncs.c
+++ b/src/backend/nodes/makefuncs.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/makefuncs.c,v 1.17 1999/08/21 03:48:58 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/makefuncs.c,v 1.18 1999/08/22 20:14:59 tgl Exp $
*
* NOTES
* Creator functions in POSTGRES 4.2 are generated automatically. Most of
@@ -52,9 +52,7 @@ makeVar(Index varno,
AttrNumber varattno,
Oid vartype,
int32 vartypmod,
- Index varlevelsup,
- Index varnoold,
- AttrNumber varoattno)
+ Index varlevelsup)
{
Var *var = makeNode(Var);
@@ -63,8 +61,14 @@ makeVar(Index varno,
var->vartype = vartype;
var->vartypmod = vartypmod;
var->varlevelsup = varlevelsup;
- var->varnoold = varnoold;
- var->varoattno = varoattno;
+ /*
+ * Since few if any routines ever create Var nodes with varnoold/varoattno
+ * different from varno/varattno, we don't provide separate arguments
+ * for them, but just initialize them to the given varno/varattno.
+ * This reduces code clutter and chance of error for most callers.
+ */
+ var->varnoold = varno;
+ var->varoattno = varattno;
return var;
}