mirror of
https://github.com/postgres/postgres.git
synced 2025-06-29 10:41:53 +03:00
Replace non-idiomatic nconc(x, lcons(y, NIL)) with lappend(x, y).
This commit is contained in:
@ -5,7 +5,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* 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 $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -337,24 +337,21 @@ new_join_tlist(List *tlist,
|
|||||||
{
|
{
|
||||||
int resdomno = first_resdomno - 1;
|
int resdomno = first_resdomno - 1;
|
||||||
TargetEntry *xtl = NULL;
|
TargetEntry *xtl = NULL;
|
||||||
List *temp_node = NIL;
|
|
||||||
List *t_list = NIL;
|
List *t_list = NIL;
|
||||||
List *i = NIL;
|
List *i = NIL;
|
||||||
List *join_list = NIL;
|
List *join_list = NIL;
|
||||||
bool in_final_tlist = false;
|
bool in_final_tlist = false;
|
||||||
|
|
||||||
|
|
||||||
foreach(i, tlist)
|
foreach(i, tlist)
|
||||||
{
|
{
|
||||||
xtl = lfirst(i);
|
xtl = lfirst(i);
|
||||||
|
/* XXX surely this is wrong? join_list is never changed? tgl 2/99 */
|
||||||
in_final_tlist = (join_list == NIL);
|
in_final_tlist = (join_list == NIL);
|
||||||
if (in_final_tlist)
|
if (in_final_tlist)
|
||||||
{
|
{
|
||||||
resdomno += 1;
|
resdomno += 1;
|
||||||
temp_node = lcons(create_tl_element(get_expr(xtl),
|
t_list = lappend(t_list,
|
||||||
resdomno),
|
create_tl_element(get_expr(xtl), resdomno));
|
||||||
NIL);
|
|
||||||
t_list = nconc(t_list, temp_node);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -590,7 +587,6 @@ static List *
|
|||||||
geqo_final_join_rels(List *join_rel_list)
|
geqo_final_join_rels(List *join_rel_list)
|
||||||
{
|
{
|
||||||
List *xrel = NIL;
|
List *xrel = NIL;
|
||||||
List *temp = NIL;
|
|
||||||
List *t_list = NIL;
|
List *t_list = NIL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -615,8 +611,7 @@ geqo_final_join_rels(List *join_rel_list)
|
|||||||
}
|
}
|
||||||
if (final)
|
if (final)
|
||||||
{
|
{
|
||||||
temp = lcons(rel, NIL);
|
t_list = lappend(t_list, rel);
|
||||||
t_list = nconc(t_list, temp);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* 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 $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -66,10 +66,9 @@ geqo_prune_rels(List *rel_list)
|
|||||||
static List *
|
static List *
|
||||||
geqo_prune_rel(RelOptInfo *rel, List *other_rels)
|
geqo_prune_rel(RelOptInfo *rel, List *other_rels)
|
||||||
{
|
{
|
||||||
List *i = NIL;
|
|
||||||
List *t_list = NIL;
|
List *t_list = NIL;
|
||||||
List *temp_node = NIL;
|
List *i;
|
||||||
RelOptInfo *other_rel = (RelOptInfo *) NULL;
|
RelOptInfo *other_rel;
|
||||||
|
|
||||||
foreach(i, other_rels)
|
foreach(i, other_rels)
|
||||||
{
|
{
|
||||||
@ -79,12 +78,10 @@ geqo_prune_rel(RelOptInfo *rel, List *other_rels)
|
|||||||
rel->pathlist = add_pathlist(rel,
|
rel->pathlist = add_pathlist(rel,
|
||||||
rel->pathlist,
|
rel->pathlist,
|
||||||
other_rel->pathlist);
|
other_rel->pathlist);
|
||||||
t_list = nconc(t_list, NIL); /* XXX is this right ? */
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
temp_node = lcons(other_rel, NIL);
|
t_list = lappend(t_list, other_rel);
|
||||||
t_list = nconc(t_list, temp_node);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return t_list;
|
return t_list;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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 $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -170,14 +170,13 @@ find_index_paths(Query *root,
|
|||||||
|
|
||||||
if (joinclausegroups != NIL)
|
if (joinclausegroups != NIL)
|
||||||
{
|
{
|
||||||
List *new_join_paths = create_index_paths(root, rel,
|
joinpaths = create_index_paths(root, rel,
|
||||||
index,
|
index,
|
||||||
joinclausegroups,
|
joinclausegroups,
|
||||||
true);
|
true);
|
||||||
List *innerjoin_paths = index_innerjoin(root, rel, joinclausegroups, index);
|
rel->innerjoin = nconc(rel->innerjoin,
|
||||||
|
index_innerjoin(root, rel,
|
||||||
rel->innerjoin = nconc(rel->innerjoin, innerjoin_paths);
|
joinclausegroups, index));
|
||||||
joinpaths = new_join_paths;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1360,7 +1359,6 @@ create_index_paths(Query *root,
|
|||||||
foreach(i, clausegroup_list)
|
foreach(i, clausegroup_list)
|
||||||
{
|
{
|
||||||
RestrictInfo *restrictinfo;
|
RestrictInfo *restrictinfo;
|
||||||
List *temp_node = NIL;
|
|
||||||
bool temp = true;
|
bool temp = true;
|
||||||
|
|
||||||
clausegroup = lfirst(i);
|
clausegroup = lfirst(i);
|
||||||
@ -1377,8 +1375,7 @@ create_index_paths(Query *root,
|
|||||||
if (!join || temp)
|
if (!join || temp)
|
||||||
{ /* restriction, ordering scan */
|
{ /* restriction, ordering scan */
|
||||||
temp_path = create_index_path(root, rel, index, clausegroup, join);
|
temp_path = create_index_path(root, rel, index, clausegroup, join);
|
||||||
temp_node = lcons(temp_path, NIL);
|
ip_list = lappend(ip_list, temp_path);
|
||||||
ip_list = nconc(ip_list, temp_node);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ip_list;
|
return ip_list;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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 $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -422,7 +422,6 @@ match_unsorted_inner(RelOptInfo *joinrel,
|
|||||||
{
|
{
|
||||||
Path *innerpath = (Path *) NULL;
|
Path *innerpath = (Path *) NULL;
|
||||||
List *mp_list = NIL;
|
List *mp_list = NIL;
|
||||||
List *temp_node = NIL;
|
|
||||||
PathOrder *innerpath_ordering = NULL;
|
PathOrder *innerpath_ordering = NULL;
|
||||||
Cost temp1 = 0.0;
|
Cost temp1 = 0.0;
|
||||||
bool temp2 = false;
|
bool temp2 = false;
|
||||||
@ -482,7 +481,8 @@ match_unsorted_inner(RelOptInfo *joinrel,
|
|||||||
joinrel->targetlist,
|
joinrel->targetlist,
|
||||||
clauses);
|
clauses);
|
||||||
|
|
||||||
temp_node = lcons(create_mergejoin_path(joinrel,
|
mp_list = lappend(mp_list,
|
||||||
|
create_mergejoin_path(joinrel,
|
||||||
outerrel->size,
|
outerrel->size,
|
||||||
innerrel->size,
|
innerrel->size,
|
||||||
outerrel->width,
|
outerrel->width,
|
||||||
@ -493,10 +493,7 @@ match_unsorted_inner(RelOptInfo *joinrel,
|
|||||||
xmergeinfo->m_ordering,
|
xmergeinfo->m_ordering,
|
||||||
matchedJoinClauses,
|
matchedJoinClauses,
|
||||||
outerkeys,
|
outerkeys,
|
||||||
NIL),
|
NIL));
|
||||||
NIL);
|
|
||||||
|
|
||||||
mp_list = nconc(mp_list, temp_node);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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 $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -165,7 +165,6 @@ find_clauseless_joins(RelOptInfo *outer_rel, List *inner_rels)
|
|||||||
{
|
{
|
||||||
RelOptInfo *inner_rel;
|
RelOptInfo *inner_rel;
|
||||||
List *t_list = NIL;
|
List *t_list = NIL;
|
||||||
List *temp_node = NIL;
|
|
||||||
List *i = NIL;
|
List *i = NIL;
|
||||||
|
|
||||||
foreach(i, inner_rels)
|
foreach(i, inner_rels)
|
||||||
@ -173,11 +172,10 @@ find_clauseless_joins(RelOptInfo *outer_rel, List *inner_rels)
|
|||||||
inner_rel = (RelOptInfo *) lfirst(i);
|
inner_rel = (RelOptInfo *) lfirst(i);
|
||||||
if (nonoverlap_rels(inner_rel, outer_rel))
|
if (nonoverlap_rels(inner_rel, outer_rel))
|
||||||
{
|
{
|
||||||
temp_node = lcons(init_join_rel(outer_rel,
|
t_list = lappend(t_list,
|
||||||
|
init_join_rel(outer_rel,
|
||||||
inner_rel,
|
inner_rel,
|
||||||
(JoinInfo *) NULL),
|
(JoinInfo *) NULL));
|
||||||
NIL);
|
|
||||||
t_list = nconc(t_list, temp_node);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -278,24 +276,21 @@ new_join_tlist(List *tlist,
|
|||||||
{
|
{
|
||||||
int resdomno = first_resdomno - 1;
|
int resdomno = first_resdomno - 1;
|
||||||
TargetEntry *xtl = NULL;
|
TargetEntry *xtl = NULL;
|
||||||
List *temp_node = NIL;
|
|
||||||
List *t_list = NIL;
|
List *t_list = NIL;
|
||||||
List *i = NIL;
|
List *i = NIL;
|
||||||
List *join_list = NIL;
|
List *join_list = NIL;
|
||||||
bool in_final_tlist = false;
|
bool in_final_tlist = false;
|
||||||
|
|
||||||
|
|
||||||
foreach(i, tlist)
|
foreach(i, tlist)
|
||||||
{
|
{
|
||||||
xtl = lfirst(i);
|
xtl = lfirst(i);
|
||||||
|
/* XXX surely this is wrong? join_list is never changed? tgl 2/99 */
|
||||||
in_final_tlist = (join_list == NIL);
|
in_final_tlist = (join_list == NIL);
|
||||||
if (in_final_tlist)
|
if (in_final_tlist)
|
||||||
{
|
{
|
||||||
resdomno += 1;
|
resdomno += 1;
|
||||||
temp_node = lcons(create_tl_element(get_expr(xtl),
|
t_list = lappend(t_list,
|
||||||
resdomno),
|
create_tl_element(get_expr(xtl), resdomno));
|
||||||
NIL);
|
|
||||||
t_list = nconc(t_list, temp_node);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -479,7 +474,6 @@ List *
|
|||||||
final_join_rels(List *join_rel_list)
|
final_join_rels(List *join_rel_list)
|
||||||
{
|
{
|
||||||
List *xrel = NIL;
|
List *xrel = NIL;
|
||||||
List *temp = NIL;
|
|
||||||
List *t_list = NIL;
|
List *t_list = NIL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -504,8 +498,7 @@ final_join_rels(List *join_rel_list)
|
|||||||
}
|
}
|
||||||
if (final)
|
if (final)
|
||||||
{
|
{
|
||||||
temp = lcons(rel, NIL);
|
t_list = lappend(t_list, rel);
|
||||||
t_list = nconc(t_list, temp);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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 $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -410,11 +410,10 @@ new_matching_subkeys(Var *subkey,
|
|||||||
List *join_rel_tlist,
|
List *join_rel_tlist,
|
||||||
List *joinclauses)
|
List *joinclauses)
|
||||||
{
|
{
|
||||||
Expr *joinclause = NULL;
|
|
||||||
List *t_list = NIL;
|
List *t_list = NIL;
|
||||||
List *temp = NIL;
|
Expr *joinclause;
|
||||||
List *i = NIL;
|
List *i;
|
||||||
Expr *tlist_other_var = (Expr *) NULL;
|
Expr *tlist_other_var;
|
||||||
|
|
||||||
foreach(i, joinclauses)
|
foreach(i, joinclauses)
|
||||||
{
|
{
|
||||||
@ -436,8 +435,7 @@ new_matching_subkeys(Var *subkey,
|
|||||||
* am not sure of this.
|
* am not sure of this.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
temp = lcons(tlist_other_var, NIL);
|
t_list = lappend(t_list, tlist_other_var);
|
||||||
t_list = nconc(t_list, temp);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return t_list;
|
return t_list;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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 $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -385,8 +385,7 @@ create_indexscan_node(IndexPath *best_path,
|
|||||||
lcons(index_clause, NIL));
|
lcons(index_clause, NIL));
|
||||||
|
|
||||||
if (lossy)
|
if (lossy)
|
||||||
qpqual = nconc(qpqual,
|
qpqual = lappend(qpqual, (List *) copyObject(index_clause));
|
||||||
lcons((List *) copyObject(index_clause), NIL));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1200,8 +1199,7 @@ generate_fjoin(List *tlist)
|
|||||||
inner,
|
inner,
|
||||||
results,
|
results,
|
||||||
alwaysDone);
|
alwaysDone);
|
||||||
tempList = lcons(fjoinNode, NIL);
|
tempList = lcons(fjoinNode, fjoinList);
|
||||||
tempList = nconc(tempList, fjoinList);
|
|
||||||
newTlist = lappend(newTlist, tempList);
|
newTlist = lappend(newTlist, tempList);
|
||||||
}
|
}
|
||||||
return newTlist;
|
return newTlist;
|
||||||
|
Reference in New Issue
Block a user