1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-14 08:21:07 +03:00

Desultory de-FastList-ification. RelOptInfo.reltargetlist is back to

being a plain List.
This commit is contained in:
Tom Lane
2004-06-01 03:03:05 +00:00
parent 6c33054a0c
commit 80c6847cc5
8 changed files with 38 additions and 45 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/path/allpaths.c,v 1.116 2004/05/30 23:40:28 neilc Exp $
* $PostgreSQL: pgsql/src/backend/optimizer/path/allpaths.c,v 1.117 2004/06/01 03:02:51 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -246,7 +246,6 @@ set_inherited_rel_pathlist(Query *root, RelOptInfo *rel,
RangeTblEntry *childrte;
Oid childOID;
RelOptInfo *childrel;
List *reltlist;
ListCell *parentvars;
ListCell *childvars;
@ -268,14 +267,12 @@ set_inherited_rel_pathlist(Query *root, RelOptInfo *rel,
* the individual tables. Also, we just zap attr_needed rather
* than trying to adjust it; it won't be looked at in the child.
*/
reltlist = FastListValue(&rel->reltargetlist);
reltlist = (List *)
adjust_inherited_attrs((Node *) reltlist,
childrel->reltargetlist = (List *)
adjust_inherited_attrs((Node *) rel->reltargetlist,
parentRTindex,
parentOID,
childRTindex,
childOID);
FastListFromList(&childrel->reltargetlist, reltlist);
childrel->attr_needed = NULL;
childrel->baserestrictinfo = (List *)
adjust_inherited_attrs((Node *) rel->baserestrictinfo,
@ -300,8 +297,8 @@ set_inherited_rel_pathlist(Query *root, RelOptInfo *rel,
if (childrel->width > rel->width)
rel->width = childrel->width;
childvars = list_head(FastListValue(&childrel->reltargetlist));
foreach(parentvars, FastListValue(&rel->reltargetlist))
forboth(parentvars, rel->reltargetlist,
childvars, childrel->reltargetlist)
{
Var *parentvar = (Var *) lfirst(parentvars);
Var *childvar = (Var *) lfirst(childvars);
@ -310,7 +307,6 @@ set_inherited_rel_pathlist(Query *root, RelOptInfo *rel,
if (childrel->attr_widths[childndx] > rel->attr_widths[parentndx])
rel->attr_widths[parentndx] = childrel->attr_widths[childndx];
childvars = lnext(childvars);
}
}

View File

@ -49,7 +49,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/path/costsize.c,v 1.128 2004/05/30 23:40:28 neilc Exp $
* $PostgreSQL: pgsql/src/backend/optimizer/path/costsize.c,v 1.129 2004/06/01 03:02:52 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -1701,7 +1701,7 @@ set_rel_width(Query *root, RelOptInfo *rel)
int32 tuple_width = 0;
ListCell *tllist;
foreach(tllist, FastListValue(&rel->reltargetlist))
foreach(tllist, rel->reltargetlist)
{
Var *var = (Var *) lfirst(tllist);
int ndx = var->varattno - rel->min_attr;

View File

@ -11,7 +11,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/path/pathkeys.c,v 1.58 2004/05/30 23:40:28 neilc Exp $
* $PostgreSQL: pgsql/src/backend/optimizer/path/pathkeys.c,v 1.59 2004/06/01 03:02:52 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -721,12 +721,11 @@ find_indexkey_var(Query *root, RelOptInfo *rel, AttrNumber varattno)
vartypeid;
int32 type_mod;
foreach(temp, FastListValue(&rel->reltargetlist))
foreach(temp, rel->reltargetlist)
{
Var *var = (Var *) lfirst(temp);
if (IsA(var, Var) &&
var->varattno == varattno)
if (var->varattno == varattno)
return var;
}