mirror of
https://github.com/postgres/postgres.git
synced 2025-07-03 20:02:46 +03:00
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 ...
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user