mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +03:00
Cleanup of source files where 'return' or 'var =' is alone on a line.
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: geqo_eval.c,v 1.25 1999/02/03 20:15:24 momjian Exp $
|
||||
* $Id: geqo_eval.c,v 1.26 1999/02/03 21:16:19 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -269,11 +269,9 @@ init_join_rel(RelOptInfo * outer_rel, RelOptInfo * inner_rel, JoinInfo * joininf
|
||||
* of the outer and inner join relations and then merging the results
|
||||
* together.
|
||||
*/
|
||||
new_outer_tlist =
|
||||
new_join_tlist(outer_rel->targetlist, /* XXX 1-based attnos */
|
||||
new_outer_tlist = new_join_tlist(outer_rel->targetlist, /* XXX 1-based attnos */
|
||||
inner_rel->relids, 1);
|
||||
new_inner_tlist =
|
||||
new_join_tlist(inner_rel->targetlist, /* XXX 1-based attnos */
|
||||
new_inner_tlist = new_join_tlist(inner_rel->targetlist, /* XXX 1-based attnos */
|
||||
outer_rel->relids,
|
||||
length(new_outer_tlist) + 1);
|
||||
|
||||
@@ -355,8 +353,7 @@ new_join_tlist(List *tlist,
|
||||
if (in_final_tlist)
|
||||
{
|
||||
resdomno += 1;
|
||||
temp_node =
|
||||
lcons(create_tl_element(get_expr(xtl),
|
||||
temp_node = lcons(create_tl_element(get_expr(xtl),
|
||||
resdomno),
|
||||
NIL);
|
||||
t_list = nconc(t_list, temp_node);
|
||||
@@ -540,8 +537,7 @@ geqo_add_new_joininfos(Query *root, List *joinrels, List *outerrels)
|
||||
new_joininfo->mergejoinable = mergejoinable;
|
||||
new_joininfo->hashjoinable = hashjoinable;
|
||||
new_joininfo->inactive = false;
|
||||
rel->joininfo =
|
||||
lappend(rel->joininfo, new_joininfo);
|
||||
rel->joininfo = lappend(rel->joininfo, new_joininfo);
|
||||
|
||||
foreach(xsuper_rel, super_rels)
|
||||
{
|
||||
@@ -550,8 +546,7 @@ geqo_add_new_joininfos(Query *root, List *joinrels, List *outerrels)
|
||||
if (nonoverlap_rels(super_rel, joinrel))
|
||||
{
|
||||
List *new_relids = super_rel->relids;
|
||||
JoinInfo *other_joininfo =
|
||||
joininfo_member(new_relids,
|
||||
JoinInfo *other_joininfo = joininfo_member(new_relids,
|
||||
joinrel->joininfo);
|
||||
|
||||
if (other_joininfo)
|
||||
@@ -569,8 +564,7 @@ geqo_add_new_joininfos(Query *root, List *joinrels, List *outerrels)
|
||||
new_joininfo->mergejoinable = mergejoinable;
|
||||
new_joininfo->hashjoinable = hashjoinable;
|
||||
new_joininfo->inactive = false;
|
||||
joinrel->joininfo =
|
||||
lappend(joinrel->joininfo,
|
||||
joinrel->joininfo = lappend(joinrel->joininfo,
|
||||
new_joininfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: geqo_main.c,v 1.11 1998/09/01 04:29:18 momjian Exp $
|
||||
* $Id: geqo_main.c,v 1.12 1999/02/03 21:16:22 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -189,8 +189,7 @@ geqo(Query *root)
|
||||
pmx(momma->string, daddy->string, kid->string, pool->string_length);
|
||||
#elif defined(CX)
|
||||
/* CYCLE CROSSOVER */
|
||||
cycle_diffs =
|
||||
cx(momma->string, daddy->string, kid->string, pool->string_length, city_table);
|
||||
cycle_diffs = cx(momma->string, daddy->string, kid->string, pool->string_length, city_table);
|
||||
/* mutate the child */
|
||||
if (cycle_diffs == 0)
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: geqo_params.c,v 1.11 1999/01/17 06:18:27 momjian Exp $
|
||||
* $Id: geqo_params.c,v 1.12 1999/02/03 21:16:23 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -85,8 +85,7 @@ geqo_params(int string_length)
|
||||
|
||||
|
||||
/* put together the full pathname to the config file */
|
||||
conf_file =
|
||||
(char *) palloc((strlen(DataDir) + strlen(GEQO_FILE) + 2) * sizeof(char));
|
||||
conf_file = (char *) palloc((strlen(DataDir) + strlen(GEQO_FILE) + 2) * sizeof(char));
|
||||
|
||||
sprintf(conf_file, "%s/%s", DataDir, GEQO_FILE);
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: geqo_pool.c,v 1.9 1998/09/01 03:23:13 momjian Exp $
|
||||
* $Id: geqo_pool.c,v 1.10 1999/02/03 21:16:23 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -109,8 +109,7 @@ random_init_pool(Query *root, Pool *pool, int strt, int stp)
|
||||
* "geqo_recombination.c"
|
||||
* */
|
||||
|
||||
pool->data[i].worth =
|
||||
geqo_eval(root, chromo[i].string, pool->string_length); /* "from geqo_eval.c" */
|
||||
pool->data[i].worth = geqo_eval(root, chromo[i].string, pool->string_length); /* "from geqo_eval.c" */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: geqo_selection.c,v 1.5 1998/09/01 03:23:16 momjian Exp $
|
||||
* $Id: geqo_selection.c,v 1.6 1999/02/03 21:16:23 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -97,8 +97,7 @@ linear(int pool_size, double bias) /* bias is y-intercept of linear
|
||||
double index; /* index between 0 and pop_size */
|
||||
double max = (double) pool_size;
|
||||
|
||||
index =
|
||||
max * (bias - sqrt((bias * bias) - 4.0 * (bias - 1.0) * geqo_rand()))
|
||||
index = max * (bias - sqrt((bias * bias) - 4.0 * (bias - 1.0) * geqo_rand()))
|
||||
/ 2.0 / (bias - 1.0);
|
||||
|
||||
return (int) index;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/clausesel.c,v 1.15 1999/02/03 20:15:28 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/clausesel.c,v 1.16 1999/02/03 21:16:24 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -131,8 +131,7 @@ set_rest_selec(Query *root, List *restrictinfo_list)
|
||||
*/
|
||||
if (valid_or_clause(clausenode) || FLOAT_IS_ZERO(cost_clause))
|
||||
{
|
||||
clausenode->selectivity =
|
||||
compute_clause_selec(root,
|
||||
clausenode->selectivity = compute_clause_selec(root,
|
||||
(Node *) clausenode->clause,
|
||||
lcons(makeFloat(cost_clause), NIL));
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/hashutils.c,v 1.8 1999/02/03 20:15:32 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/hashutils.c,v 1.9 1999/02/03 21:16:25 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -60,8 +60,7 @@ group_clauses_by_hashop(List *restrictinfo_list,
|
||||
Var *rightop = get_rightop(clause);
|
||||
JoinKey *keys = (JoinKey *) NULL;
|
||||
|
||||
xhashinfo =
|
||||
match_hashop_hashinfo(hashjoinop, hashinfo_list);
|
||||
xhashinfo = match_hashop_hashinfo(hashjoinop, hashinfo_list);
|
||||
|
||||
if (inner_relid == leftop->varno)
|
||||
{
|
||||
@@ -89,11 +88,9 @@ group_clauses_by_hashop(List *restrictinfo_list,
|
||||
hashinfo_list = nreverse(hashinfo_list);
|
||||
}
|
||||
|
||||
xhashinfo->jmethod.clauses =
|
||||
lcons(clause, xhashinfo->jmethod.clauses);
|
||||
xhashinfo->jmethod.clauses = lcons(clause, xhashinfo->jmethod.clauses);
|
||||
|
||||
xhashinfo->jmethod.jmkeys =
|
||||
lcons(keys, xhashinfo->jmethod.jmkeys);
|
||||
xhashinfo->jmethod.jmkeys = lcons(keys, xhashinfo->jmethod.jmkeys);
|
||||
}
|
||||
}
|
||||
return hashinfo_list;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.36 1999/02/03 20:15:32 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.37 1999/02/03 21:16:26 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -238,8 +238,7 @@ match_index_orclauses(RelOptInfo * rel,
|
||||
* each of its subclauses. The list is generated by adding
|
||||
* 'index' to the existing list where appropriate.
|
||||
*/
|
||||
restrictinfo->indexids =
|
||||
match_index_orclause(rel, index, indexkey,
|
||||
restrictinfo->indexids = match_index_orclause(rel, index, indexkey,
|
||||
xclass,
|
||||
restrictinfo->clause->args,
|
||||
restrictinfo->indexids);
|
||||
@@ -649,8 +648,7 @@ match_clause_to_indexkey(RelOptInfo * rel,
|
||||
{
|
||||
restrict_op = oprid(newop);
|
||||
|
||||
isIndexable =
|
||||
(op_class(restrict_op, xclass, index->relam) &&
|
||||
isIndexable = (op_class(restrict_op, xclass, index->relam) &&
|
||||
IndexScanableOperand(leftop,
|
||||
indexkey,
|
||||
rel,
|
||||
@@ -670,8 +668,7 @@ match_clause_to_indexkey(RelOptInfo * rel,
|
||||
else if ((leftop && IsA(leftop, Const)) ||
|
||||
(leftop && IsA(leftop, Param)))
|
||||
{
|
||||
restrict_op =
|
||||
get_commutator(((Oper *) ((Expr *) clause)->oper)->opno);
|
||||
restrict_op = get_commutator(((Oper *) ((Expr *) clause)->oper)->opno);
|
||||
|
||||
isIndexable = ((restrict_op != InvalidOid) &&
|
||||
op_class(restrict_op, xclass, index->relam) &&
|
||||
@@ -703,8 +700,7 @@ match_clause_to_indexkey(RelOptInfo * rel,
|
||||
|
||||
if (HeapTupleIsValid(newop) && (oprid(newop) != restrict_op))
|
||||
{
|
||||
restrict_op =
|
||||
get_commutator(oprid(newop));
|
||||
restrict_op = get_commutator(oprid(newop));
|
||||
|
||||
isIndexable = ((restrict_op != InvalidOid) &&
|
||||
op_class(restrict_op, xclass, index->relam) &&
|
||||
@@ -1201,8 +1197,7 @@ indexable_joinclauses(RelOptInfo * rel, RelOptInfo * index,
|
||||
|
||||
if (joininfo->jinfo_restrictinfo == NIL)
|
||||
continue;
|
||||
clausegroups =
|
||||
group_clauses_by_ikey_for_joins(rel,
|
||||
clausegroups = group_clauses_by_ikey_for_joins(rel,
|
||||
index,
|
||||
index->indexkeys,
|
||||
index->classlist,
|
||||
@@ -1213,8 +1208,7 @@ indexable_joinclauses(RelOptInfo * rel, RelOptInfo * index,
|
||||
{
|
||||
List *clauses = lfirst(clausegroups);
|
||||
|
||||
((RestrictInfo *) lfirst(clauses))->cinfojoinid =
|
||||
joininfo->otherrels;
|
||||
((RestrictInfo *) lfirst(clauses))->cinfojoinid = joininfo->otherrels;
|
||||
}
|
||||
cg_list = nconc(cg_list, clausegroups);
|
||||
}
|
||||
@@ -1306,8 +1300,7 @@ index_innerjoin(Query *root, RelOptInfo * rel, List *clausegroup_list,
|
||||
|
||||
pathnode->path.joinid = ((RestrictInfo *) lfirst(clausegroup))->cinfojoinid;
|
||||
|
||||
pathnode->path.path_cost =
|
||||
cost_index((Oid) lfirsti(index->relids),
|
||||
pathnode->path.path_cost = cost_index((Oid) lfirsti(index->relids),
|
||||
(int) temp_pages,
|
||||
temp_selec,
|
||||
rel->pages,
|
||||
@@ -1320,16 +1313,14 @@ index_innerjoin(Query *root, RelOptInfo * rel, List *clausegroup_list,
|
||||
* copy restrictinfo list into path for expensive function
|
||||
* processing -- JMH, 7/7/92
|
||||
*/
|
||||
pathnode->path.loc_restrictinfo =
|
||||
set_difference(copyObject((Node *) rel->restrictinfo),
|
||||
pathnode->path.loc_restrictinfo = set_difference(copyObject((Node *) rel->restrictinfo),
|
||||
clausegroup);
|
||||
|
||||
#if 0 /* fix xfunc */
|
||||
/* add in cost for expensive functions! -- JMH, 7/7/92 */
|
||||
if (XfuncMode != XFUNC_OFF)
|
||||
{
|
||||
((Path *) pathnode)->path_cost +=
|
||||
xfunc_get_path_cost((Path *) pathnode);
|
||||
((Path *) pathnode)->path_cost += xfunc_get_path_cost((Path *) pathnode);
|
||||
}
|
||||
#endif
|
||||
cg_list = lappend(cg_list, pathnode);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.11 1999/02/03 20:15:33 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.12 1999/02/03 21:16:27 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -96,15 +96,13 @@ find_all_join_paths(Query *root, List *joinrels)
|
||||
outerrel->relids);
|
||||
if (_enable_mergejoin_)
|
||||
{
|
||||
mergeinfo_list =
|
||||
group_clauses_by_order(joinrel->restrictinfo,
|
||||
mergeinfo_list = group_clauses_by_order(joinrel->restrictinfo,
|
||||
lfirsti(innerrel->relids));
|
||||
}
|
||||
|
||||
if (_enable_hashjoin_)
|
||||
{
|
||||
hashinfo_list =
|
||||
group_clauses_by_hashop(joinrel->restrictinfo,
|
||||
hashinfo_list = group_clauses_by_hashop(joinrel->restrictinfo,
|
||||
lfirsti(innerrel->relids));
|
||||
}
|
||||
|
||||
@@ -123,8 +121,7 @@ find_all_join_paths(Query *root, List *joinrels)
|
||||
* explicitly sorted. This may include either nestloops and
|
||||
* mergejoins where the outer path is already ordered.
|
||||
*/
|
||||
pathlist =
|
||||
add_pathlist(joinrel, pathlist,
|
||||
pathlist = add_pathlist(joinrel, pathlist,
|
||||
match_unsorted_outer(joinrel,
|
||||
outerrel,
|
||||
innerrel,
|
||||
@@ -139,8 +136,7 @@ find_all_join_paths(Query *root, List *joinrels)
|
||||
* the actual nestloop nodes were constructed in
|
||||
* (match-unsorted-outer).
|
||||
*/
|
||||
pathlist =
|
||||
add_pathlist(joinrel, pathlist,
|
||||
pathlist = add_pathlist(joinrel, pathlist,
|
||||
match_unsorted_inner(joinrel, outerrel,
|
||||
innerrel,
|
||||
innerrel->pathlist,
|
||||
@@ -151,8 +147,7 @@ find_all_join_paths(Query *root, List *joinrels)
|
||||
* hashed before being joined.
|
||||
*/
|
||||
|
||||
pathlist =
|
||||
add_pathlist(joinrel, pathlist,
|
||||
pathlist = add_pathlist(joinrel, pathlist,
|
||||
hash_inner_and_outer(joinrel, outerrel,
|
||||
innerrel, hashinfo_list));
|
||||
|
||||
@@ -251,22 +246,18 @@ sort_inner_and_outer(RelOptInfo * joinrel,
|
||||
{
|
||||
xmergeinfo = (MInfo *) lfirst(i);
|
||||
|
||||
outerkeys =
|
||||
extract_path_keys(xmergeinfo->jmethod.jmkeys,
|
||||
outerkeys = extract_path_keys(xmergeinfo->jmethod.jmkeys,
|
||||
outerrel->targetlist,
|
||||
OUTER);
|
||||
|
||||
innerkeys =
|
||||
extract_path_keys(xmergeinfo->jmethod.jmkeys,
|
||||
innerkeys = extract_path_keys(xmergeinfo->jmethod.jmkeys,
|
||||
innerrel->targetlist,
|
||||
INNER);
|
||||
|
||||
merge_pathkeys =
|
||||
new_join_pathkeys(outerkeys, joinrel->targetlist,
|
||||
merge_pathkeys = new_join_pathkeys(outerkeys, joinrel->targetlist,
|
||||
xmergeinfo->jmethod.clauses);
|
||||
|
||||
temp_node =
|
||||
create_mergejoin_path(joinrel,
|
||||
temp_node = create_mergejoin_path(joinrel,
|
||||
outerrel->size,
|
||||
innerrel->size,
|
||||
outerrel->width,
|
||||
@@ -342,8 +333,7 @@ match_unsorted_outer(RelOptInfo * joinrel,
|
||||
|
||||
if (outerpath_ordering)
|
||||
{
|
||||
xmergeinfo =
|
||||
match_order_mergeinfo(outerpath_ordering,
|
||||
xmergeinfo = match_order_mergeinfo(outerpath_ordering,
|
||||
mergeinfo_list);
|
||||
}
|
||||
|
||||
@@ -355,14 +345,12 @@ match_unsorted_outer(RelOptInfo * joinrel,
|
||||
List *keys = xmergeinfo->jmethod.jmkeys;
|
||||
List *clauses = xmergeinfo->jmethod.clauses;
|
||||
|
||||
matchedJoinKeys =
|
||||
match_pathkeys_joinkeys(outerpath->keys,
|
||||
matchedJoinKeys = match_pathkeys_joinkeys(outerpath->keys,
|
||||
keys,
|
||||
clauses,
|
||||
OUTER,
|
||||
&matchedJoinClauses);
|
||||
merge_pathkeys =
|
||||
new_join_pathkeys(outerpath->keys,
|
||||
merge_pathkeys = new_join_pathkeys(outerpath->keys,
|
||||
joinrel->targetlist, clauses);
|
||||
}
|
||||
else
|
||||
@@ -385,14 +373,12 @@ match_unsorted_outer(RelOptInfo * joinrel,
|
||||
{
|
||||
bool path_is_cheaper_than_sort;
|
||||
List *varkeys = NIL;
|
||||
Path *mergeinnerpath =
|
||||
match_paths_joinkeys(matchedJoinKeys,
|
||||
Path *mergeinnerpath = match_paths_joinkeys(matchedJoinKeys,
|
||||
outerpath_ordering,
|
||||
innerrel->pathlist,
|
||||
INNER);
|
||||
|
||||
path_is_cheaper_than_sort =
|
||||
(bool) (mergeinnerpath &&
|
||||
path_is_cheaper_than_sort = (bool) (mergeinnerpath &&
|
||||
(mergeinnerpath->path_cost <
|
||||
(cheapest_inner->path_cost +
|
||||
cost_sort(matchedJoinKeys,
|
||||
@@ -401,8 +387,7 @@ match_unsorted_outer(RelOptInfo * joinrel,
|
||||
false))));
|
||||
if (!path_is_cheaper_than_sort)
|
||||
{
|
||||
varkeys =
|
||||
extract_path_keys(matchedJoinKeys,
|
||||
varkeys = extract_path_keys(matchedJoinKeys,
|
||||
innerrel->targetlist,
|
||||
INNER);
|
||||
}
|
||||
@@ -419,8 +404,7 @@ match_unsorted_outer(RelOptInfo * joinrel,
|
||||
else
|
||||
mergeinnerpath = cheapest_inner;
|
||||
|
||||
temp_node =
|
||||
lcons(create_mergejoin_path(joinrel,
|
||||
temp_node = lcons(create_mergejoin_path(joinrel,
|
||||
outerrel->size,
|
||||
innerrel->size,
|
||||
outerrel->width,
|
||||
@@ -492,8 +476,7 @@ match_unsorted_inner(RelOptInfo * joinrel,
|
||||
|
||||
if (innerpath_ordering)
|
||||
{
|
||||
xmergeinfo =
|
||||
match_order_mergeinfo(innerpath_ordering,
|
||||
xmergeinfo = match_order_mergeinfo(innerpath_ordering,
|
||||
mergeinfo_list);
|
||||
}
|
||||
|
||||
@@ -505,8 +488,7 @@ match_unsorted_inner(RelOptInfo * joinrel,
|
||||
List *keys = xmergeinfo->jmethod.jmkeys;
|
||||
List *cls = xmergeinfo->jmethod.clauses;
|
||||
|
||||
matchedJoinKeys =
|
||||
match_pathkeys_joinkeys(innerpath->keys,
|
||||
matchedJoinKeys = match_pathkeys_joinkeys(innerpath->keys,
|
||||
keys,
|
||||
cls,
|
||||
INNER,
|
||||
@@ -528,17 +510,14 @@ match_unsorted_inner(RelOptInfo * joinrel,
|
||||
|
||||
if (temp2)
|
||||
{
|
||||
List *outerkeys =
|
||||
extract_path_keys(matchedJoinKeys,
|
||||
List *outerkeys = extract_path_keys(matchedJoinKeys,
|
||||
outerrel->targetlist,
|
||||
OUTER);
|
||||
List *merge_pathkeys =
|
||||
new_join_pathkeys(outerkeys,
|
||||
List *merge_pathkeys = new_join_pathkeys(outerkeys,
|
||||
joinrel->targetlist,
|
||||
clauses);
|
||||
|
||||
temp_node =
|
||||
lcons(create_mergejoin_path(joinrel,
|
||||
temp_node = lcons(create_mergejoin_path(joinrel,
|
||||
outerrel->size,
|
||||
innerrel->size,
|
||||
outerrel->width,
|
||||
@@ -611,16 +590,13 @@ hash_inner_and_outer(RelOptInfo * joinrel,
|
||||
foreach(i, hashinfo_list)
|
||||
{
|
||||
xhashinfo = (HInfo *) lfirst(i);
|
||||
outerkeys =
|
||||
extract_path_keys(((JoinMethod *) xhashinfo)->jmkeys,
|
||||
outerkeys = extract_path_keys(((JoinMethod *) xhashinfo)->jmkeys,
|
||||
outerrel->targetlist,
|
||||
OUTER);
|
||||
innerkeys =
|
||||
extract_path_keys(((JoinMethod *) xhashinfo)->jmkeys,
|
||||
innerkeys = extract_path_keys(((JoinMethod *) xhashinfo)->jmkeys,
|
||||
innerrel->targetlist,
|
||||
INNER);
|
||||
hash_pathkeys =
|
||||
new_join_pathkeys(outerkeys,
|
||||
hash_pathkeys = new_join_pathkeys(outerkeys,
|
||||
joinrel->targetlist,
|
||||
((JoinMethod *) xhashinfo)->clauses);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.16 1999/02/03 20:15:33 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.17 1999/02/03 21:16:27 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -203,11 +203,9 @@ init_join_rel(RelOptInfo * outer_rel, RelOptInfo * inner_rel, JoinInfo * joininf
|
||||
* of the outer and inner join relations and then merging the results
|
||||
* together.
|
||||
*/
|
||||
new_outer_tlist =
|
||||
new_join_tlist(outer_rel->targetlist, /* XXX 1-based attnos */
|
||||
new_outer_tlist = new_join_tlist(outer_rel->targetlist, /* XXX 1-based attnos */
|
||||
inner_rel->relids, 1);
|
||||
new_inner_tlist =
|
||||
new_join_tlist(inner_rel->targetlist, /* XXX 1-based attnos */
|
||||
new_inner_tlist = new_join_tlist(inner_rel->targetlist, /* XXX 1-based attnos */
|
||||
outer_rel->relids,
|
||||
length(new_outer_tlist) + 1);
|
||||
|
||||
@@ -243,8 +241,7 @@ init_join_rel(RelOptInfo * outer_rel, RelOptInfo * inner_rel, JoinInfo * joininf
|
||||
joininfo->inactive = true;
|
||||
}
|
||||
|
||||
joinrel_joininfo_list =
|
||||
new_joininfo_list(append(outer_rel->joininfo, inner_rel->joininfo),
|
||||
joinrel_joininfo_list = new_joininfo_list(append(outer_rel->joininfo, inner_rel->joininfo),
|
||||
intAppend(outer_rel->relids, inner_rel->relids));
|
||||
|
||||
joinrel->joininfo = joinrel_joininfo_list;
|
||||
@@ -291,8 +288,7 @@ new_join_tlist(List *tlist,
|
||||
if (in_final_tlist)
|
||||
{
|
||||
resdomno += 1;
|
||||
temp_node =
|
||||
lcons(create_tl_element(get_expr(xtl),
|
||||
temp_node = lcons(create_tl_element(get_expr(xtl),
|
||||
resdomno),
|
||||
NIL);
|
||||
t_list = nconc(t_list, temp_node);
|
||||
@@ -346,8 +342,7 @@ new_joininfo_list(List *joininfo_list, List *join_relids)
|
||||
current_joininfo_list);
|
||||
if (other_joininfo)
|
||||
{
|
||||
other_joininfo->jinfo_restrictinfo =
|
||||
(List *) LispUnion(joininfo->jinfo_restrictinfo,
|
||||
other_joininfo->jinfo_restrictinfo = (List *) LispUnion(joininfo->jinfo_restrictinfo,
|
||||
other_joininfo->jinfo_restrictinfo);
|
||||
}
|
||||
else
|
||||
@@ -425,8 +420,7 @@ add_new_joininfos(Query *root, List *joinrels, List *outerrels)
|
||||
new_joininfo->mergejoinable = mergejoinable;
|
||||
new_joininfo->hashjoinable = hashjoinable;
|
||||
new_joininfo->inactive = false;
|
||||
rel->joininfo =
|
||||
lappend(rel->joininfo, new_joininfo);
|
||||
rel->joininfo = lappend(rel->joininfo, new_joininfo);
|
||||
|
||||
foreach(xsuper_rel, super_rels)
|
||||
{
|
||||
@@ -435,14 +429,12 @@ add_new_joininfos(Query *root, List *joinrels, List *outerrels)
|
||||
if (nonoverlap_rels(super_rel, joinrel))
|
||||
{
|
||||
List *new_relids = super_rel->relids;
|
||||
JoinInfo *other_joininfo =
|
||||
joininfo_member(new_relids,
|
||||
JoinInfo *other_joininfo = joininfo_member(new_relids,
|
||||
joinrel->joininfo);
|
||||
|
||||
if (other_joininfo)
|
||||
{
|
||||
other_joininfo->jinfo_restrictinfo =
|
||||
(List *) LispUnion(restrict_info,
|
||||
other_joininfo->jinfo_restrictinfo = (List *) LispUnion(restrict_info,
|
||||
other_joininfo->jinfo_restrictinfo);
|
||||
}
|
||||
else
|
||||
@@ -454,8 +446,7 @@ add_new_joininfos(Query *root, List *joinrels, List *outerrels)
|
||||
new_joininfo->mergejoinable = mergejoinable;
|
||||
new_joininfo->hashjoinable = hashjoinable;
|
||||
new_joininfo->inactive = false;
|
||||
joinrel->joininfo =
|
||||
lappend(joinrel->joininfo,
|
||||
joinrel->joininfo = lappend(joinrel->joininfo,
|
||||
new_joininfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/joinutils.c,v 1.8 1998/09/01 04:29:38 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/joinutils.c,v 1.9 1999/02/03 21:16:27 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -85,8 +85,7 @@ match_pathkeys_joinkeys(List *pathkeys,
|
||||
foreach(i, pathkeys)
|
||||
{
|
||||
pathkey = lfirst(i);
|
||||
matched_joinkey_index =
|
||||
match_pathkey_joinkeys(pathkey, joinkeys, which_subkey);
|
||||
matched_joinkey_index = match_pathkey_joinkeys(pathkey, joinkeys, which_subkey);
|
||||
|
||||
if (matched_joinkey_index != -1)
|
||||
{
|
||||
@@ -287,8 +286,7 @@ extract_path_keys(List *joinkeys,
|
||||
if (p != NIL)
|
||||
continue; /* key already in pathkeys */
|
||||
|
||||
pathkeys =
|
||||
lappend(pathkeys, lcons(key, NIL));
|
||||
pathkeys = lappend(pathkeys, lcons(key, NIL));
|
||||
}
|
||||
return pathkeys;
|
||||
}
|
||||
@@ -371,8 +369,7 @@ new_join_pathkey(List *subkeys,
|
||||
subkey = (Var *) lfirst(i);
|
||||
if (subkey == NULL)
|
||||
break; /* XXX something is wrong */
|
||||
matched_subkeys =
|
||||
new_matching_subkeys(subkey, considered_subkeys,
|
||||
matched_subkeys = new_matching_subkeys(subkey, considered_subkeys,
|
||||
join_rel_tlist, joinclauses);
|
||||
tlist_key = matching_tlvar(subkey, join_rel_tlist);
|
||||
newly_considered_subkeys = NIL;
|
||||
@@ -386,8 +383,7 @@ new_join_pathkey(List *subkeys,
|
||||
else
|
||||
newly_considered_subkeys = matched_subkeys;
|
||||
|
||||
considered_subkeys =
|
||||
append(considered_subkeys, newly_considered_subkeys);
|
||||
considered_subkeys = append(considered_subkeys, newly_considered_subkeys);
|
||||
|
||||
t_list = nconc(t_list, newly_considered_subkeys);
|
||||
}
|
||||
@@ -426,8 +422,7 @@ new_matching_subkeys(Var *subkey,
|
||||
foreach(i, joinclauses)
|
||||
{
|
||||
joinclause = lfirst(i);
|
||||
tlist_other_var =
|
||||
matching_tlvar(other_join_clause_var(subkey, joinclause),
|
||||
tlist_other_var = matching_tlvar(other_join_clause_var(subkey, joinclause),
|
||||
join_rel_tlist);
|
||||
|
||||
if (tlist_other_var &&
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/mergeutils.c,v 1.10 1999/02/03 20:15:33 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/mergeutils.c,v 1.11 1999/02/03 21:16:27 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -84,11 +84,9 @@ group_clauses_by_order(List *restrictinfo_list,
|
||||
mergeinfo_list);
|
||||
}
|
||||
|
||||
((JoinMethod *) xmergeinfo)->clauses =
|
||||
lcons(clause,
|
||||
((JoinMethod *) xmergeinfo)->clauses = lcons(clause,
|
||||
((JoinMethod *) xmergeinfo)->clauses);
|
||||
((JoinMethod *) xmergeinfo)->jmkeys =
|
||||
lcons(keys,
|
||||
((JoinMethod *) xmergeinfo)->jmkeys = lcons(keys,
|
||||
((JoinMethod *) xmergeinfo)->jmkeys);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/orindxpath.c,v 1.13 1999/02/03 20:15:33 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/orindxpath.c,v 1.14 1999/02/03 21:16:28 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -121,16 +121,14 @@ create_or_index_paths(Query *root,
|
||||
* copy restrictinfo list into path for expensive function
|
||||
* processing -- JMH, 7/7/92
|
||||
*/
|
||||
pathnode->path.loc_restrictinfo =
|
||||
set_difference(copyObject((Node *) rel->restrictinfo),
|
||||
pathnode->path.loc_restrictinfo = set_difference(copyObject((Node *) rel->restrictinfo),
|
||||
lcons(clausenode, NIL));
|
||||
|
||||
#if 0 /* fix xfunc */
|
||||
/* add in cost for expensive functions! -- JMH, 7/7/92 */
|
||||
if (XfuncMode != XFUNC_OFF)
|
||||
{
|
||||
((Path *) pathnode)->path_cost +=
|
||||
xfunc_get_path_cost((Path) pathnode);
|
||||
((Path *) pathnode)->path_cost += xfunc_get_path_cost((Path) pathnode);
|
||||
}
|
||||
#endif
|
||||
clausenode->selectivity = (Cost) floatVal(selecs);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/predmig.c,v 1.14 1999/02/03 20:15:34 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/predmig.c,v 1.15 1999/02/03 21:16:28 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -256,13 +256,11 @@ xfunc_llel_chains(Stream root, Stream bottom)
|
||||
* i.e. it would be lower than the attributes it references.
|
||||
*/
|
||||
Assert(xfunc_num_relids(pathstream) > xfunc_num_relids(tmpstream));
|
||||
progress =
|
||||
xfunc_prdmig_pullup(origstream, tmpstream,
|
||||
progress = xfunc_prdmig_pullup(origstream, tmpstream,
|
||||
(JoinPath) get_pathptr(pathstream));
|
||||
}
|
||||
if (get_downstream(tmpstream))
|
||||
pathstream =
|
||||
(Stream) xfunc_get_downjoin((Stream) get_downstream(tmpstream));
|
||||
pathstream = (Stream) xfunc_get_downjoin((Stream) get_downstream(tmpstream));
|
||||
}
|
||||
|
||||
/* free up origstream */
|
||||
@@ -526,8 +524,7 @@ xfunc_add_clauses(Stream current)
|
||||
/* first add in the local clauses */
|
||||
foreach(temp, get_loc_restrictinfo((Path) get_pathptr(current)))
|
||||
{
|
||||
topnode =
|
||||
xfunc_streaminsert((RestrictInfo) lfirst(temp), topnode,
|
||||
topnode = xfunc_streaminsert((RestrictInfo) lfirst(temp), topnode,
|
||||
XFUNC_LOCPRD);
|
||||
}
|
||||
|
||||
@@ -538,8 +535,7 @@ xfunc_add_clauses(Stream current)
|
||||
foreach(temp, get_pathrestrictinfo((JoinPath) get_pathptr(current)))
|
||||
{
|
||||
if (!equal(get_clause((RestrictInfo) lfirst(temp)), primjoin))
|
||||
topnode =
|
||||
xfunc_streaminsert((RestrictInfo) lfirst(temp), topnode,
|
||||
topnode = xfunc_streaminsert((RestrictInfo) lfirst(temp), topnode,
|
||||
XFUNC_JOINPRD);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.23 1999/02/03 20:15:34 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.24 1999/02/03 21:16:29 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -80,8 +80,7 @@ xfunc_trypullup(RelOptInfo rel)
|
||||
for (ever)
|
||||
{
|
||||
/* No, the following should NOT be '==' !! */
|
||||
if (clausetype =
|
||||
xfunc_shouldpull((Path) get_innerjoinpath(curpath),
|
||||
if (clausetype = xfunc_shouldpull((Path) get_innerjoinpath(curpath),
|
||||
curpath, INNER, &maxcinfo))
|
||||
{
|
||||
|
||||
@@ -96,8 +95,7 @@ xfunc_trypullup(RelOptInfo rel)
|
||||
{
|
||||
|
||||
/* No, the following should NOT be '==' !! */
|
||||
if (clausetype =
|
||||
xfunc_shouldpull((Path) get_outerjoinpath(curpath),
|
||||
if (clausetype = xfunc_shouldpull((Path) get_outerjoinpath(curpath),
|
||||
curpath, OUTER, &maxcinfo))
|
||||
{
|
||||
|
||||
@@ -644,8 +642,7 @@ xfunc_width(LispValue clause)
|
||||
{
|
||||
/* Param node projects a complex type */
|
||||
Assert(length(get_param_tlist((Param) clause)) == 1); /* sanity */
|
||||
retval =
|
||||
xfunc_width((LispValue)
|
||||
retval = xfunc_width((LispValue)
|
||||
get_expr(lfirst(get_param_tlist((Param) clause))));
|
||||
}
|
||||
else
|
||||
@@ -696,8 +693,7 @@ xfunc_width(LispValue clause)
|
||||
* the projected attribute
|
||||
*/
|
||||
Assert(length(get_func_tlist(func)) == 1); /* sanity */
|
||||
retval =
|
||||
xfunc_width((LispValue)
|
||||
retval = xfunc_width((LispValue)
|
||||
get_expr(lfirst(get_func_tlist(func))));
|
||||
goto exit;
|
||||
}
|
||||
@@ -774,8 +770,7 @@ xfunc_card_product(Query *queryInfo, Relid relids)
|
||||
foreach(cinfonode, get_restrictinfo(currel))
|
||||
{
|
||||
if (!xfunc_expense(queryInfo, get_clause((RestrictInfo) lfirst(cinfonode))))
|
||||
tuples *=
|
||||
compute_clause_selec(queryInfo,
|
||||
tuples *= compute_clause_selec(queryInfo,
|
||||
get_clause((RestrictInfo) lfirst(cinfonode)),
|
||||
LispNil);
|
||||
}
|
||||
@@ -1240,8 +1235,7 @@ xfunc_disjunct_sort(LispValue clause_list)
|
||||
|
||||
foreach(temp, clause_list)
|
||||
if (or_clause(lfirst(temp)))
|
||||
lnext(lfirst(temp)) =
|
||||
lisp_qsort(lnext(lfirst(temp)), xfunc_disjunct_compare);
|
||||
lnext(lfirst(temp)) = lisp_qsort(lnext(lfirst(temp)), xfunc_disjunct_compare);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.35 1999/02/03 20:15:37 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.36 1999/02/03 21:16:30 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -396,11 +396,9 @@ create_indexscan_node(IndexPath *best_path,
|
||||
(List *) copyObject(lfirst(indxqual)));
|
||||
}
|
||||
|
||||
fixed_indxqual =
|
||||
(List *) fix_indxqual_references((Node *) indxqual, (Path *) best_path);
|
||||
fixed_indxqual = (List *) fix_indxqual_references((Node *) indxqual, (Path *) best_path);
|
||||
|
||||
scan_node =
|
||||
make_indexscan(tlist,
|
||||
scan_node = make_indexscan(tlist,
|
||||
qpqual,
|
||||
lfirsti(best_path->path.parent->relids),
|
||||
best_path->indexid,
|
||||
@@ -470,12 +468,10 @@ create_nestloop_node(JoinPath *best_path,
|
||||
List *new_inner_qual = NIL;
|
||||
|
||||
clauses = set_difference(clauses, inner_indxqual); /* XXX */
|
||||
new_inner_qual =
|
||||
index_outerjoin_references(inner_indxqual,
|
||||
new_inner_qual = index_outerjoin_references(inner_indxqual,
|
||||
outer_node->targetlist,
|
||||
((Scan *) inner_node)->scanrelid);
|
||||
((IndexScan *) inner_node)->indxqual =
|
||||
lcons(new_inner_qual, NIL);
|
||||
((IndexScan *) inner_node)->indxqual = lcons(new_inner_qual, NIL);
|
||||
}
|
||||
}
|
||||
else if (IsA_Join(inner_node))
|
||||
@@ -533,17 +529,14 @@ create_mergejoin_node(MergePath *best_path,
|
||||
outer_tlist,
|
||||
inner_tlist));
|
||||
|
||||
opcode =
|
||||
get_opcode((best_path->jpath.path.p_ordering.ord.merge)->join_operator);
|
||||
opcode = get_opcode((best_path->jpath.path.p_ordering.ord.merge)->join_operator);
|
||||
|
||||
outer_order = (Oid *) palloc(sizeof(Oid) * 2);
|
||||
outer_order[0] =
|
||||
(best_path->jpath.path.p_ordering.ord.merge)->left_operator;
|
||||
outer_order[0] = (best_path->jpath.path.p_ordering.ord.merge)->left_operator;
|
||||
outer_order[1] = 0;
|
||||
|
||||
inner_order = (Oid *) palloc(sizeof(Oid) * 2);
|
||||
inner_order[0] =
|
||||
(best_path->jpath.path.p_ordering.ord.merge)->right_operator;
|
||||
inner_order[0] = (best_path->jpath.path.p_ordering.ord.merge)->right_operator;
|
||||
inner_order[1] = 0;
|
||||
|
||||
/*
|
||||
@@ -615,8 +608,7 @@ create_hashjoin_node(HashPath *best_path,
|
||||
* Separate the hashclauses from the other join qualification clauses
|
||||
* and set those clauses to contain references to lower attributes.
|
||||
*/
|
||||
qpqual =
|
||||
join_references(set_difference(clauses,
|
||||
qpqual = join_references(set_difference(clauses,
|
||||
best_path->path_hashclauses),
|
||||
outer_tlist,
|
||||
inner_tlist);
|
||||
@@ -625,8 +617,7 @@ create_hashjoin_node(HashPath *best_path,
|
||||
* Now set the references in the hashclauses and rearrange them so
|
||||
* that the outer variable is always on the left.
|
||||
*/
|
||||
hashclauses =
|
||||
switch_outer(join_references(best_path->path_hashclauses,
|
||||
hashclauses = switch_outer(join_references(best_path->path_hashclauses,
|
||||
outer_tlist,
|
||||
inner_tlist));
|
||||
|
||||
@@ -690,8 +681,7 @@ fix_indxqual_references(Node *clause, Path *index_path)
|
||||
is_funcclause((Node *) get_leftop((Expr *) clause)) &&
|
||||
((Func *) ((Expr *) get_leftop((Expr *) clause))->oper)->funcisindex)
|
||||
{
|
||||
Var *newvar =
|
||||
makeVar((Index) lfirsti(index_path->parent->relids),
|
||||
Var *newvar = makeVar((Index) lfirsti(index_path->parent->relids),
|
||||
1, /* func indices have one key */
|
||||
((Func *) ((Expr *) clause)->oper)->functype,
|
||||
-1,
|
||||
@@ -699,8 +689,7 @@ fix_indxqual_references(Node *clause, Path *index_path)
|
||||
(Index) lfirsti(index_path->parent->relids),
|
||||
0);
|
||||
|
||||
return
|
||||
((Node *) make_opclause((Oper *) ((Expr *) clause)->oper,
|
||||
return ((Node *) make_opclause((Oper *) ((Expr *) clause)->oper,
|
||||
newvar,
|
||||
get_rightop((Expr *) clause)));
|
||||
|
||||
@@ -716,8 +705,7 @@ fix_indxqual_references(Node *clause, Path *index_path)
|
||||
{
|
||||
subclause = lfirst(i);
|
||||
if (subclause)
|
||||
new_subclauses =
|
||||
lappend(new_subclauses,
|
||||
new_subclauses = lappend(new_subclauses,
|
||||
fix_indxqual_references(subclause,
|
||||
index_path));
|
||||
|
||||
@@ -751,8 +739,7 @@ fix_indxqual_references(Node *clause, Path *index_path)
|
||||
{
|
||||
subclause = lfirst(i);
|
||||
if (subclause)
|
||||
new_subclauses =
|
||||
lappend(new_subclauses,
|
||||
new_subclauses = lappend(new_subclauses,
|
||||
fix_indxqual_references(subclause,
|
||||
index_path));
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.21 1999/02/03 20:15:38 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.22 1999/02/03 21:16:35 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -208,8 +208,7 @@ add_clause_to_rels(Query *root, List *clause)
|
||||
}
|
||||
else
|
||||
{
|
||||
restrictinfo->selectivity =
|
||||
compute_clause_selec(root, (Node *) clause, NIL);
|
||||
restrictinfo->selectivity = compute_clause_selec(root, (Node *) clause, NIL);
|
||||
}
|
||||
rel->restrictinfo = lcons(restrictinfo, rel->restrictinfo);
|
||||
}
|
||||
@@ -232,8 +231,7 @@ add_clause_to_rels(Query *root, List *clause)
|
||||
}
|
||||
else
|
||||
{
|
||||
restrictinfo->selectivity =
|
||||
compute_clause_selec(root, (Node *) clause, NIL);
|
||||
restrictinfo->selectivity = compute_clause_selec(root, (Node *) clause, NIL);
|
||||
}
|
||||
add_join_info_to_rels(root, restrictinfo, relids);
|
||||
/* we are going to be doing a join, so add var to targetlist */
|
||||
@@ -272,8 +270,7 @@ add_join_info_to_rels(Query *root, RestrictInfo * restrictinfo, List *join_relid
|
||||
|
||||
joininfo = find_joininfo_node(get_base_rel(root, lfirsti(join_relid)),
|
||||
other_rels);
|
||||
joininfo->jinfo_restrictinfo =
|
||||
lcons(copyObject((void *) restrictinfo), joininfo->jinfo_restrictinfo);
|
||||
joininfo->jinfo_restrictinfo = lcons(copyObject((void *) restrictinfo), joininfo->jinfo_restrictinfo);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.41 1999/02/03 20:15:39 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.42 1999/02/03 21:16:36 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -124,8 +124,7 @@ union_planner(Query *parse)
|
||||
parse->resultRelation,
|
||||
parse->rtable);
|
||||
}
|
||||
else if ((rt_index =
|
||||
first_inherit_rt_entry(rangetable)) != -1)
|
||||
else if ((rt_index = first_inherit_rt_entry(rangetable)) != -1)
|
||||
{
|
||||
if (parse->rowMark != NULL)
|
||||
elog(ERROR, "SELECT FOR UPDATE is not supported for inherit queries");
|
||||
@@ -263,8 +262,7 @@ union_planner(Query *parse)
|
||||
* get the varno/attno entries to the appropriate references to
|
||||
* the result tuple of the subplans.
|
||||
*/
|
||||
((Agg *) result_plan)->aggs =
|
||||
get_agg_tlist_references((Agg *) result_plan);
|
||||
((Agg *) result_plan)->aggs = get_agg_tlist_references((Agg *) result_plan);
|
||||
|
||||
/***S*H***/
|
||||
if(parse->havingQual!=NULL)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.36 1999/02/03 20:15:39 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.37 1999/02/03 21:16:38 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -150,8 +150,7 @@ set_tempscan_tlist_references(SeqScan *tempscan)
|
||||
{
|
||||
Temp *temp = (Temp *) ((Plan *) tempscan)->lefttree;
|
||||
|
||||
((Plan *) tempscan)->targetlist =
|
||||
tlist_temp_references(temp->tempid,
|
||||
((Plan *) tempscan)->targetlist = tlist_temp_references(temp->tempid,
|
||||
((Plan *) tempscan)->targetlist);
|
||||
set_temp_tlist_references(temp);
|
||||
}
|
||||
@@ -175,8 +174,7 @@ set_temp_tlist_references(Temp *temp)
|
||||
if (source != NULL)
|
||||
{
|
||||
set_tlist_references(source);
|
||||
((Plan *) temp)->targetlist =
|
||||
copy_vars(((Plan *) temp)->targetlist,
|
||||
((Plan *) temp)->targetlist = copy_vars(((Plan *) temp)->targetlist,
|
||||
(source)->targetlist);
|
||||
}
|
||||
else
|
||||
@@ -307,8 +305,7 @@ replace_clause_joinvar_refs(Expr *clause,
|
||||
return (List *) clause;
|
||||
else if (and_clause((Node *) clause))
|
||||
{
|
||||
List *andclause =
|
||||
replace_subclause_joinvar_refs(((Expr *) clause)->args,
|
||||
List *andclause = replace_subclause_joinvar_refs(((Expr *) clause)->args,
|
||||
outer_tlist,
|
||||
inner_tlist);
|
||||
|
||||
@@ -316,8 +313,7 @@ replace_clause_joinvar_refs(Expr *clause,
|
||||
}
|
||||
else if (or_clause((Node *) clause))
|
||||
{
|
||||
List *orclause =
|
||||
replace_subclause_joinvar_refs(((Expr *) clause)->args,
|
||||
List *orclause = replace_subclause_joinvar_refs(((Expr *) clause)->args,
|
||||
outer_tlist,
|
||||
inner_tlist);
|
||||
|
||||
@@ -351,8 +347,7 @@ replace_clause_joinvar_refs(Expr *clause,
|
||||
}
|
||||
else if (is_funcclause((Node *) clause))
|
||||
{
|
||||
List *funcclause =
|
||||
replace_subclause_joinvar_refs(((Expr *) clause)->args,
|
||||
List *funcclause = replace_subclause_joinvar_refs(((Expr *) clause)->args,
|
||||
outer_tlist,
|
||||
inner_tlist);
|
||||
|
||||
@@ -361,8 +356,7 @@ replace_clause_joinvar_refs(Expr *clause,
|
||||
}
|
||||
else if (not_clause((Node *) clause))
|
||||
{
|
||||
List *notclause =
|
||||
replace_clause_joinvar_refs(get_notclausearg(clause),
|
||||
List *notclause = replace_clause_joinvar_refs(get_notclausearg(clause),
|
||||
outer_tlist,
|
||||
inner_tlist);
|
||||
|
||||
@@ -370,12 +364,10 @@ replace_clause_joinvar_refs(Expr *clause,
|
||||
}
|
||||
else if (is_opclause((Node *) clause))
|
||||
{
|
||||
Var *leftvar =
|
||||
(Var *) replace_clause_joinvar_refs((Expr *) get_leftop(clause),
|
||||
Var *leftvar = (Var *) replace_clause_joinvar_refs((Expr *) get_leftop(clause),
|
||||
outer_tlist,
|
||||
inner_tlist);
|
||||
Var *rightvar =
|
||||
(Var *) replace_clause_joinvar_refs((Expr *) get_rightop(clause),
|
||||
Var *rightvar = (Var *) replace_clause_joinvar_refs((Expr *) get_rightop(clause),
|
||||
outer_tlist,
|
||||
inner_tlist);
|
||||
|
||||
@@ -385,8 +377,7 @@ replace_clause_joinvar_refs(Expr *clause,
|
||||
}
|
||||
else if (is_subplan(clause))
|
||||
{
|
||||
((Expr *) clause)->args =
|
||||
replace_subclause_joinvar_refs(((Expr *) clause)->args,
|
||||
((Expr *) clause)->args = replace_subclause_joinvar_refs(((Expr *) clause)->args,
|
||||
outer_tlist,
|
||||
inner_tlist);
|
||||
((SubPlan *) ((Expr *) clause)->oper)->sublink->oper =
|
||||
@@ -965,8 +956,7 @@ check_having_qual_for_vars(Node *clause, List *targetlist_so_far)
|
||||
}
|
||||
else if (IsA(clause, Aggref))
|
||||
{
|
||||
targetlist_so_far =
|
||||
check_having_qual_for_vars(((Aggref *) clause)->target, targetlist_so_far);
|
||||
targetlist_so_far = check_having_qual_for_vars(((Aggref *) clause)->target, targetlist_so_far);
|
||||
return targetlist_so_far;
|
||||
}
|
||||
else if (IsA(clause, ArrayRef))
|
||||
|
||||
@@ -340,8 +340,7 @@ SS_replace_correlation_vars(Node *expr)
|
||||
}
|
||||
else if (IsA(expr, Iter))
|
||||
{
|
||||
((Iter *) expr)->iterexpr =
|
||||
SS_replace_correlation_vars(((Iter *) expr)->iterexpr);
|
||||
((Iter *) expr)->iterexpr = SS_replace_correlation_vars(((Iter *) expr)->iterexpr);
|
||||
}
|
||||
else if (single_node(expr))
|
||||
return expr;
|
||||
@@ -350,22 +349,18 @@ SS_replace_correlation_vars(Node *expr)
|
||||
((Expr *) expr)->args = (List *)
|
||||
SS_replace_correlation_vars((Node *) ((Expr *) expr)->args);
|
||||
else if (IsA(expr, Aggref))
|
||||
((Aggref *) expr)->target =
|
||||
SS_replace_correlation_vars((Node *) ((Aggref *) expr)->target);
|
||||
((Aggref *) expr)->target = SS_replace_correlation_vars((Node *) ((Aggref *) expr)->target);
|
||||
else if (IsA(expr, ArrayRef))
|
||||
{
|
||||
((ArrayRef *) expr)->refupperindexpr = (List *)
|
||||
SS_replace_correlation_vars((Node *) ((ArrayRef *) expr)->refupperindexpr);
|
||||
((ArrayRef *) expr)->reflowerindexpr = (List *)
|
||||
SS_replace_correlation_vars((Node *) ((ArrayRef *) expr)->reflowerindexpr);
|
||||
((ArrayRef *) expr)->refexpr =
|
||||
SS_replace_correlation_vars((Node *) ((ArrayRef *) expr)->refexpr);
|
||||
((ArrayRef *) expr)->refassgnexpr =
|
||||
SS_replace_correlation_vars(((ArrayRef *) expr)->refassgnexpr);
|
||||
((ArrayRef *) expr)->refexpr = SS_replace_correlation_vars((Node *) ((ArrayRef *) expr)->refexpr);
|
||||
((ArrayRef *) expr)->refassgnexpr = SS_replace_correlation_vars(((ArrayRef *) expr)->refassgnexpr);
|
||||
}
|
||||
else if (IsA(expr, TargetEntry))
|
||||
((TargetEntry *) expr)->expr =
|
||||
SS_replace_correlation_vars((Node *) ((TargetEntry *) expr)->expr);
|
||||
((TargetEntry *) expr)->expr = SS_replace_correlation_vars((Node *) ((TargetEntry *) expr)->expr);
|
||||
else if (IsA(expr, SubLink))
|
||||
{
|
||||
List *le;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepqual.c,v 1.11 1998/10/04 03:30:56 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepqual.c,v 1.12 1999/02/03 21:16:44 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -384,8 +384,7 @@ push_nots(Expr *qual)
|
||||
0, NULL);
|
||||
|
||||
op->op_fcache = (FunctionCache *) NULL;
|
||||
return
|
||||
(make_opclause(op, get_leftop(qual), get_rightop(qual)));
|
||||
return (make_opclause(op, get_leftop(qual), get_rightop(qual)));
|
||||
}
|
||||
else
|
||||
return make_notclause(qual);
|
||||
@@ -458,8 +457,7 @@ or_normalize(List *orlist)
|
||||
|
||||
if (new_orlist)
|
||||
{
|
||||
return
|
||||
(or_normalize(lcons(distribute_args(lfirst(new_orlist),
|
||||
return (or_normalize(lcons(distribute_args(lfirst(new_orlist),
|
||||
((Expr *) distributable)->args),
|
||||
lnext(new_orlist))));
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/preptlist.c,v 1.16 1998/09/01 04:29:57 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/preptlist.c,v 1.17 1999/02/03 21:16:45 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -71,8 +71,7 @@ preprocess_targetlist(List *tlist,
|
||||
* order of the attributes. We also need to fill in the missing
|
||||
* attributes here. -ay 10/94
|
||||
*/
|
||||
expanded_tlist =
|
||||
expand_targetlist(tlist, relid, command_type, result_relation);
|
||||
expanded_tlist = expand_targetlist(tlist, relid, command_type, result_relation);
|
||||
|
||||
/* XXX should the fix-opids be this early?? */
|
||||
/* was mapCAR */
|
||||
@@ -196,8 +195,7 @@ replace_matching_resname(List *new_tlist, List *old_tlist)
|
||||
|
||||
if (matching_old_tl)
|
||||
{
|
||||
matching_old_tl->resdom->resno =
|
||||
new_tle->resdom->resno;
|
||||
matching_old_tl->resdom->resno = new_tle->resdom->resno;
|
||||
t_list = lappend(t_list, matching_old_tl);
|
||||
}
|
||||
else
|
||||
@@ -307,8 +305,7 @@ new_relation_targetlist(Oid relid, Index rt_index, NodeTag node_type)
|
||||
Var *temp_var = (Var *) NULL;
|
||||
TargetEntry *temp_list = NULL;
|
||||
|
||||
temp_var =
|
||||
makeVar(rt_index, attno, atttype,
|
||||
temp_var = makeVar(rt_index, attno, atttype,
|
||||
get_atttypmod(relid, attno),
|
||||
0, rt_index, attno);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.27 1998/09/01 04:29:59 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.28 1999/02/03 21:16:46 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -222,8 +222,7 @@ plan_inherit_queries(Query *parse, Index rt_index)
|
||||
List *inheritrtable = NIL;
|
||||
List *union_relids = NIL;
|
||||
|
||||
union_relids =
|
||||
find_all_inheritors(lconsi(rt_entry->relid,
|
||||
union_relids = find_all_inheritors(lconsi(rt_entry->relid,
|
||||
NIL),
|
||||
NIL);
|
||||
|
||||
@@ -442,8 +441,7 @@ fix_parsetree_attnums_nodes(Index rt_index,
|
||||
|
||||
if (var->varno == rt_index && var->varattno != 0)
|
||||
{
|
||||
var->varattno =
|
||||
get_attnum(new_typeid,
|
||||
var->varattno = get_attnum(new_typeid,
|
||||
get_attname(old_typeid, var->varattno));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/clauseinfo.c,v 1.10 1999/02/03 20:15:39 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/clauseinfo.c,v 1.11 1999/02/03 21:16:50 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -183,8 +183,7 @@ get_opnos(List *restrictinfo_list)
|
||||
foreach(i, restrictinfo_list)
|
||||
{
|
||||
temp = (RestrictInfo *) lfirst(i);
|
||||
result =
|
||||
lappendi(result,
|
||||
result = lappendi(result,
|
||||
(((Oper *) temp->clause->oper)->opno));
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.27 1999/01/24 00:28:21 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.28 1999/02/03 21:16:51 momjian Exp $
|
||||
*
|
||||
* HISTORY
|
||||
* AUTHOR DATE MAJOR EVENT
|
||||
@@ -83,8 +83,7 @@ make_clause(int type, Node *oper, List *args)
|
||||
bool
|
||||
is_opclause(Node *clause)
|
||||
{
|
||||
return
|
||||
(clause != NULL &&
|
||||
return (clause != NULL &&
|
||||
nodeTag(clause) == T_Expr && ((Expr *) clause)->opType == OP_EXPR);
|
||||
}
|
||||
|
||||
@@ -144,8 +143,7 @@ get_rightop(Expr *clause)
|
||||
static bool
|
||||
agg_clause(Node *clause)
|
||||
{
|
||||
return
|
||||
(clause != NULL && nodeTag(clause) == T_Aggref);
|
||||
return (clause != NULL && nodeTag(clause) == T_Aggref);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
@@ -161,8 +159,7 @@ agg_clause(Node *clause)
|
||||
bool
|
||||
is_funcclause(Node *clause)
|
||||
{
|
||||
return
|
||||
(clause != NULL &&
|
||||
return (clause != NULL &&
|
||||
nodeTag(clause) == T_Expr && ((Expr *) clause)->opType == FUNC_EXPR);
|
||||
}
|
||||
|
||||
@@ -234,8 +231,7 @@ make_orclause(List *orclauses)
|
||||
bool
|
||||
not_clause(Node *clause)
|
||||
{
|
||||
return
|
||||
(clause != NULL &&
|
||||
return (clause != NULL &&
|
||||
nodeTag(clause) == T_Expr && ((Expr *) clause)->opType == NOT_EXPR);
|
||||
}
|
||||
|
||||
@@ -283,8 +279,7 @@ get_notclausearg(Expr *notclause)
|
||||
bool
|
||||
and_clause(Node *clause)
|
||||
{
|
||||
return
|
||||
(clause != NULL &&
|
||||
return (clause != NULL &&
|
||||
nodeTag(clause) == T_Expr && ((Expr *) clause)->opType == AND_EXPR);
|
||||
}
|
||||
|
||||
@@ -321,8 +316,7 @@ make_andclause(List *andclauses)
|
||||
bool
|
||||
case_clause(Node *clause)
|
||||
{
|
||||
return
|
||||
(clause != NULL &&
|
||||
return (clause != NULL &&
|
||||
nodeTag(clause) == T_CaseExpr);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/ordering.c,v 1.8 1998/09/21 02:25:21 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/ordering.c,v 1.9 1999/02/03 21:16:51 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -43,22 +43,19 @@ equal_path_path_ordering(PathOrder *path_ordering1,
|
||||
else if (path_ordering1->ordtype == SORTOP_ORDER &&
|
||||
path_ordering2->ordtype == SORTOP_ORDER)
|
||||
{
|
||||
return
|
||||
(equal_sortops_order(path_ordering1->ord.sortop,
|
||||
return (equal_sortops_order(path_ordering1->ord.sortop,
|
||||
path_ordering2->ord.sortop));
|
||||
}
|
||||
else if (path_ordering1->ordtype == MERGE_ORDER &&
|
||||
path_ordering2->ordtype == SORTOP_ORDER)
|
||||
{
|
||||
return (path_ordering2->ord.sortop &&
|
||||
(path_ordering1->ord.merge->left_operator ==
|
||||
path_ordering2->ord.sortop[0]));
|
||||
(path_ordering1->ord.merge->left_operator == path_ordering2->ord.sortop[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
return (path_ordering1->ord.sortop &&
|
||||
(path_ordering1->ord.sortop[0] ==
|
||||
path_ordering2->ord.merge->left_operator));
|
||||
(path_ordering1->ord.sortop[0] == path_ordering2->ord.merge->left_operator));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.15 1999/02/03 20:15:42 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.16 1999/02/03 21:16:52 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -212,8 +212,7 @@ create_seqscan_path(RelOptInfo * rel)
|
||||
* copy restrictinfo list into path for expensive function processing --
|
||||
* JMH, 7/7/92
|
||||
*/
|
||||
pathnode->loc_restrictinfo =
|
||||
(List *) copyObject((Node *) rel->restrictinfo);
|
||||
pathnode->loc_restrictinfo = (List *) copyObject((Node *) rel->restrictinfo);
|
||||
|
||||
if (rel->relids != NULL)
|
||||
relid = lfirsti(rel->relids);
|
||||
@@ -224,8 +223,7 @@ create_seqscan_path(RelOptInfo * rel)
|
||||
#if 0
|
||||
if (XfuncMode != XFUNC_OFF)
|
||||
{
|
||||
pathnode->path_cost +=
|
||||
xfunc_get_path_cost(pathnode);
|
||||
pathnode->path_cost += xfunc_get_path_cost(pathnode);
|
||||
}
|
||||
#endif
|
||||
return pathnode;
|
||||
@@ -266,8 +264,7 @@ create_index_path(Query *root,
|
||||
* copy restrictinfo list into path for expensive function processing --
|
||||
* JMH, 7/7/92
|
||||
*/
|
||||
pathnode->path.loc_restrictinfo =
|
||||
set_difference((List *) copyObject((Node *) rel->restrictinfo),
|
||||
pathnode->path.loc_restrictinfo = set_difference((List *) copyObject((Node *) rel->restrictinfo),
|
||||
(List *) restriction_clauses);
|
||||
|
||||
/*
|
||||
@@ -301,8 +298,7 @@ create_index_path(Query *root,
|
||||
*/
|
||||
/* is the statement above really true? what about IndexScan as the
|
||||
inner of a join? */
|
||||
pathnode->path.path_cost =
|
||||
cost_index(lfirsti(index->relids),
|
||||
pathnode->path.path_cost = cost_index(lfirsti(index->relids),
|
||||
index->pages,
|
||||
1.0,
|
||||
rel->pages,
|
||||
@@ -314,8 +310,7 @@ create_index_path(Query *root,
|
||||
#if 0
|
||||
if (XfuncMode != XFUNC_OFF)
|
||||
{
|
||||
pathnode->path_cost =
|
||||
(pathnode->path_cost +
|
||||
pathnode->path_cost = (pathnode->path_cost +
|
||||
xfunc_get_path_cost((Path *) pathnode));
|
||||
}
|
||||
#endif
|
||||
@@ -366,8 +361,7 @@ create_index_path(Query *root,
|
||||
/* add in expensive functions cost! -- JMH, 7/7/92 */
|
||||
if (XfuncMode != XFUNC_OFF)
|
||||
{
|
||||
pathnode->path_cost +=
|
||||
xfunc_get_path_cost((Path *) pathnode);
|
||||
pathnode->path_cost += xfunc_get_path_cost((Path *) pathnode);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -418,17 +412,14 @@ create_nestloop_path(RelOptInfo * joinrel,
|
||||
|
||||
if (keys)
|
||||
{
|
||||
pathnode->path.p_ordering.ordtype =
|
||||
outer_path->p_ordering.ordtype;
|
||||
pathnode->path.p_ordering.ordtype = outer_path->p_ordering.ordtype;
|
||||
if (outer_path->p_ordering.ordtype == SORTOP_ORDER)
|
||||
{
|
||||
pathnode->path.p_ordering.ord.sortop =
|
||||
outer_path->p_ordering.ord.sortop;
|
||||
pathnode->path.p_ordering.ord.sortop = outer_path->p_ordering.ord.sortop;
|
||||
}
|
||||
else
|
||||
{
|
||||
pathnode->path.p_ordering.ord.merge =
|
||||
outer_path->p_ordering.ord.merge;
|
||||
pathnode->path.p_ordering.ord.merge = outer_path->p_ordering.ord.merge;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -437,8 +428,7 @@ create_nestloop_path(RelOptInfo * joinrel,
|
||||
pathnode->path.p_ordering.ord.sortop = NULL;
|
||||
}
|
||||
|
||||
pathnode->path.path_cost =
|
||||
cost_nestloop(outer_path->path_cost,
|
||||
pathnode->path.path_cost = cost_nestloop(outer_path->path_cost,
|
||||
inner_path->path_cost,
|
||||
outer_rel->size,
|
||||
inner_path->parent->size,
|
||||
@@ -500,8 +490,7 @@ create_mergejoin_path(RelOptInfo * joinrel,
|
||||
pathnode->jpath.path.loc_restrictinfo = NIL;
|
||||
pathnode->outersortkeys = outersortkeys;
|
||||
pathnode->innersortkeys = innersortkeys;
|
||||
pathnode->jpath.path.path_cost =
|
||||
cost_mergejoin(outer_path->path_cost,
|
||||
pathnode->jpath.path.path_cost = cost_mergejoin(outer_path->path_cost,
|
||||
inner_path->path_cost,
|
||||
outersortkeys,
|
||||
innersortkeys,
|
||||
@@ -513,8 +502,7 @@ create_mergejoin_path(RelOptInfo * joinrel,
|
||||
#if 0
|
||||
if (XfuncMode != XFUNC_OFF)
|
||||
{
|
||||
pathnode->path_cost +=
|
||||
xfunc_get_path_cost((Path *) pathnode);
|
||||
pathnode->path_cost += xfunc_get_path_cost((Path *) pathnode);
|
||||
}
|
||||
#endif
|
||||
return pathnode;
|
||||
@@ -569,8 +557,7 @@ create_hashjoin_path(RelOptInfo * joinrel,
|
||||
pathnode->path_hashclauses = hashclauses;
|
||||
pathnode->outerhashkeys = outerkeys;
|
||||
pathnode->innerhashkeys = innerkeys;
|
||||
pathnode->jpath.path.path_cost =
|
||||
cost_hashjoin(outer_path->path_cost,
|
||||
pathnode->jpath.path.path_cost = cost_hashjoin(outer_path->path_cost,
|
||||
inner_path->path_cost,
|
||||
outerkeys,
|
||||
innerkeys,
|
||||
@@ -580,8 +567,7 @@ create_hashjoin_path(RelOptInfo * joinrel,
|
||||
#if 0
|
||||
if (XfuncMode != XFUNC_OFF)
|
||||
{
|
||||
pathnode->path_cost +=
|
||||
xfunc_get_path_cost((Path *) pathnode);
|
||||
pathnode->path_cost += xfunc_get_path_cost((Path *) pathnode);
|
||||
}
|
||||
#endif
|
||||
return pathnode;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.23 1998/10/08 18:29:30 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.24 1999/02/03 21:16:52 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -219,8 +219,7 @@ index_info(Query *root, bool first, int relid, IdxInfoRetval *info)
|
||||
if (!HeapTupleIsValid(amopTuple))
|
||||
elog(ERROR, "index_info: no amop %d %d %d",
|
||||
relam, index->indclass[i], amstrategy);
|
||||
info->orderOprs[i] =
|
||||
((Form_pg_amop) GETSTRUCT(amopTuple))->amopopr;
|
||||
info->orderOprs[i] = ((Form_pg_amop) GETSTRUCT(amopTuple))->amopopr;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.22 1999/01/24 00:28:22 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.23 1999/02/03 21:16:54 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -113,8 +113,7 @@ add_tl_element(RelOptInfo * rel, Var *var)
|
||||
var->varno,
|
||||
var->varoattno);
|
||||
|
||||
rel->targetlist =
|
||||
lappend(tlist,
|
||||
rel->targetlist = lappend(tlist,
|
||||
create_tl_element(newvar,
|
||||
length(tlist) + 1));
|
||||
|
||||
@@ -462,8 +461,7 @@ flatten_tlistentry(Node *tlistentry, List *flat_tlist)
|
||||
}
|
||||
else if (IsA(tlistentry, Iter))
|
||||
{
|
||||
((Iter *) tlistentry)->iterexpr =
|
||||
flatten_tlistentry((Node *) ((Iter *) tlistentry)->iterexpr,
|
||||
((Iter *) tlistentry)->iterexpr = flatten_tlistentry((Node *) ((Iter *) tlistentry)->iterexpr,
|
||||
flat_tlist);
|
||||
return tlistentry;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user