*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: geqo_eval.c,v 1.30 1999/02/14 04:56:45 momjian Exp $
+ * $Id: geqo_eval.c,v 1.31 1999/02/15 02:04:58 tgl Exp $
*
*-------------------------------------------------------------------------
*/
{
int resdomno = first_resdomno - 1;
TargetEntry *xtl = NULL;
- List *temp_node = NIL;
List *t_list = NIL;
List *i = NIL;
List *join_list = NIL;
bool in_final_tlist = false;
-
foreach(i, tlist)
{
xtl = lfirst(i);
+ /* XXX surely this is wrong? join_list is never changed? tgl 2/99 */
in_final_tlist = (join_list == NIL);
if (in_final_tlist)
{
resdomno += 1;
- temp_node = lcons(create_tl_element(get_expr(xtl),
- resdomno),
- NIL);
- t_list = nconc(t_list, temp_node);
+ t_list = lappend(t_list,
+ create_tl_element(get_expr(xtl), resdomno));
}
}
geqo_final_join_rels(List *join_rel_list)
{
List *xrel = NIL;
- List *temp = NIL;
List *t_list = NIL;
/*
}
if (final)
{
- temp = lcons(rel, NIL);
- t_list = nconc(t_list, temp);
+ t_list = lappend(t_list, rel);
}
}
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: geqo_paths.c,v 1.20 1999/02/13 23:16:11 momjian Exp $
+ * $Id: geqo_paths.c,v 1.21 1999/02/15 02:04:58 tgl Exp $
*
*-------------------------------------------------------------------------
*/
static List *
geqo_prune_rel(RelOptInfo *rel, List *other_rels)
{
- List *i = NIL;
List *t_list = NIL;
- List *temp_node = NIL;
- RelOptInfo *other_rel = (RelOptInfo *) NULL;
+ List *i;
+ RelOptInfo *other_rel;
foreach(i, other_rels)
{
rel->pathlist = add_pathlist(rel,
rel->pathlist,
other_rel->pathlist);
- t_list = nconc(t_list, NIL); /* XXX is this right ? */
}
else
{
- temp_node = lcons(other_rel, NIL);
- t_list = nconc(t_list, temp_node);
+ t_list = lappend(t_list, other_rel);
}
}
return t_list;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.45 1999/02/15 01:06:57 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.46 1999/02/15 02:04:55 tgl Exp $
*
*-------------------------------------------------------------------------
*/
if (joinclausegroups != NIL)
{
- List *new_join_paths = create_index_paths(root, rel,
- index,
- joinclausegroups,
- true);
- List *innerjoin_paths = index_innerjoin(root, rel, joinclausegroups, index);
-
- rel->innerjoin = nconc(rel->innerjoin, innerjoin_paths);
- joinpaths = new_join_paths;
+ joinpaths = create_index_paths(root, rel,
+ index,
+ joinclausegroups,
+ true);
+ rel->innerjoin = nconc(rel->innerjoin,
+ index_innerjoin(root, rel,
+ joinclausegroups, index));
}
/*
foreach(i, clausegroup_list)
{
RestrictInfo *restrictinfo;
- List *temp_node = NIL;
bool temp = true;
clausegroup = lfirst(i);
if (!join || temp)
{ /* restriction, ordering scan */
temp_path = create_index_path(root, rel, index, clausegroup, join);
- temp_node = lcons(temp_path, NIL);
- ip_list = nconc(ip_list, temp_node);
+ ip_list = lappend(ip_list, temp_path);
}
}
return ip_list;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.25 1999/02/14 05:27:12 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.26 1999/02/15 02:04:57 tgl Exp $
*
*-------------------------------------------------------------------------
*/
{
Path *innerpath = (Path *) NULL;
List *mp_list = NIL;
- List *temp_node = NIL;
PathOrder *innerpath_ordering = NULL;
Cost temp1 = 0.0;
bool temp2 = false;
joinrel->targetlist,
clauses);
- temp_node = lcons(create_mergejoin_path(joinrel,
+ mp_list = lappend(mp_list,
+ create_mergejoin_path(joinrel,
outerrel->size,
innerrel->size,
outerrel->width,
xmergeinfo->m_ordering,
matchedJoinClauses,
outerkeys,
- NIL),
- NIL);
-
- mp_list = nconc(mp_list, temp_node);
+ NIL));
}
}
}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.21 1999/02/14 04:56:47 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.22 1999/02/15 02:04:57 tgl Exp $
*
*-------------------------------------------------------------------------
*/
{
RelOptInfo *inner_rel;
List *t_list = NIL;
- List *temp_node = NIL;
List *i = NIL;
foreach(i, inner_rels)
inner_rel = (RelOptInfo *) lfirst(i);
if (nonoverlap_rels(inner_rel, outer_rel))
{
- temp_node = lcons(init_join_rel(outer_rel,
- inner_rel,
- (JoinInfo *) NULL),
- NIL);
- t_list = nconc(t_list, temp_node);
+ t_list = lappend(t_list,
+ init_join_rel(outer_rel,
+ inner_rel,
+ (JoinInfo *) NULL));
}
}
{
int resdomno = first_resdomno - 1;
TargetEntry *xtl = NULL;
- List *temp_node = NIL;
List *t_list = NIL;
List *i = NIL;
List *join_list = NIL;
bool in_final_tlist = false;
-
foreach(i, tlist)
{
xtl = lfirst(i);
+ /* XXX surely this is wrong? join_list is never changed? tgl 2/99 */
in_final_tlist = (join_list == NIL);
if (in_final_tlist)
{
resdomno += 1;
- temp_node = lcons(create_tl_element(get_expr(xtl),
- resdomno),
- NIL);
- t_list = nconc(t_list, temp_node);
+ t_list = lappend(t_list,
+ create_tl_element(get_expr(xtl), resdomno));
}
}
final_join_rels(List *join_rel_list)
{
List *xrel = NIL;
- List *temp = NIL;
List *t_list = NIL;
/*
}
if (final)
{
- temp = lcons(rel, NIL);
- t_list = nconc(t_list, temp);
+ t_list = lappend(t_list, rel);
}
}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/joinutils.c,v 1.20 1999/02/13 23:16:19 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/joinutils.c,v 1.21 1999/02/15 02:04:57 tgl Exp $
*
*-------------------------------------------------------------------------
*/
List *join_rel_tlist,
List *joinclauses)
{
- Expr *joinclause = NULL;
List *t_list = NIL;
- List *temp = NIL;
- List *i = NIL;
- Expr *tlist_other_var = (Expr *) NULL;
+ Expr *joinclause;
+ List *i;
+ Expr *tlist_other_var;
foreach(i, joinclauses)
{
* am not sure of this.
*/
- temp = lcons(tlist_other_var, NIL);
- t_list = nconc(t_list, temp);
+ t_list = lappend(t_list, tlist_other_var);
}
}
return t_list;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.47 1999/02/15 01:06:58 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.48 1999/02/15 02:04:55 tgl Exp $
*
*-------------------------------------------------------------------------
*/
lcons(index_clause, NIL));
if (lossy)
- qpqual = nconc(qpqual,
- lcons((List *) copyObject(index_clause), NIL));
+ qpqual = lappend(qpqual, (List *) copyObject(index_clause));
}
else
{
inner,
results,
alwaysDone);
- tempList = lcons(fjoinNode, NIL);
- tempList = nconc(tempList, fjoinList);
+ tempList = lcons(fjoinNode, fjoinList);
newTlist = lappend(newTlist, tempList);
}
return newTlist;