1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-15 03:41:20 +03:00

Remove un-needed braces around single statements.

This commit is contained in:
Bruce Momjian
1998-06-15 19:30:31 +00:00
parent 27db9ecd0b
commit 6bd323c6b3
224 changed files with 221 additions and 2504 deletions

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.15 1998/02/26 04:32:27 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.16 1998/06/15 19:28:38 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -259,9 +259,7 @@ find_join_paths(Query *root, List *outer_rels, int levels_needed)
root->join_relation_list_ = outer_rels;
}
else
{
root->join_relation_list_ = new_rels;
}
if (!BushyPlanFlag)
outer_rels = new_rels;
}
@@ -407,16 +405,12 @@ debug_print_rel(Query *root, Rel *rel)
printf("(");
foreach(l, rel->relids)
{
printf("%d ", lfirsti(l));
}
printf("): size=%d width=%d\n", rel->size, rel->width);
printf("\tpath list:\n");
foreach(l, rel->pathlist)
{
print_path(root, lfirst(l), 1);
}
printf("\tcheapest path:\n");
print_path(root, rel->cheapestpath, 1);
}

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/clausesel.c,v 1.7 1998/04/27 04:05:49 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/clausesel.c,v 1.8 1998/06/15 19:28:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -54,9 +54,7 @@ set_clause_selectivities(List *clauseinfo_list, Cost new_selectivity)
clausenode = (CInfo *) lfirst(temp);
cost_clause = clausenode->selectivity;
if (FLOAT_IS_ZERO(cost_clause) || new_selectivity < cost_clause)
{
clausenode->selectivity = new_selectivity;
}
}
}
@@ -225,18 +223,14 @@ compute_selec(Query *root, List *clauses, List *or_selectivities)
List *clause = lfirst(clauses);
if (clauses == NULL)
{
s1 = 1.0;
}
else if (IsA(clause, Param))
{
/* XXX How're we handling this before?? -ay */
s1 = 1.0;
}
else if (IsA(clause, Const))
{
s1 = ((bool) ((Const *) clause)->constvalue) ? 1.0 : 0.0;
}
else if (IsA(clause, Var))
{
Oid relid = getrelid(((Var *) clause)->varno,
@@ -369,9 +363,7 @@ compute_selec(Query *root, List *clauses, List *or_selectivities)
*/
if (length(clauses) < 2)
{
return (s1);
}
else
{
/* Compute selectivity of the 'or'ed subclauses. */

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.20 1998/01/13 04:04:06 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.21 1998/06/15 19:28:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -368,13 +368,9 @@ compute_rel_size(Rel *rel)
temp = rel->tuples * product_selec(rel->clauseinfo);
Assert(temp >= 0);
if (temp >= (MAXINT - 1))
{
temp1 = MAXINT;
}
else
{
temp1 = ceil((double) temp);
}
Assert(temp1 >= 0);
Assert(temp1 <= MAXINT);
return (temp1);
@@ -449,9 +445,7 @@ compute_joinrel_size(JoinPath *joinpath)
temp = temp * product_selec(joinpath->pathclauseinfo);
if (temp >= (MAXINT - 1))
{
temp1 = MAXINT;
}
else
{

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.15 1998/04/27 04:05:53 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.16 1998/06/15 19:28:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -662,9 +662,7 @@ match_clause_to_indexkey(Rel *rel,
else if (leftop
&& match_index_to_operand(indexkey,
(Expr *) leftop, rel, index))
{
join_op = ((Oper *) ((Expr *) clause)->oper)->opno;
}
if (join_op && op_class(join_op, xclass, index->relam) &&
join_clause_p((Node *) clause))
@@ -943,9 +941,7 @@ clause_pred_clause_test(Expr *predicate, Node *clause)
!IsA(predicate->oper, Oper) ||
!IsA(pred_var, Var) ||
!IsA(pred_const, Const))
{
return false;
}
/*
* The implication can't be determined unless the predicate and the
@@ -1161,9 +1157,7 @@ extract_restrict_clauses(List *clausegroup)
CInfo *cinfo = lfirst(l);
if (!join_clause_p((Node *) cinfo->clause))
{
restrict_cls = lappend(restrict_cls, cinfo);
}
}
return restrict_cls;
}
@@ -1293,9 +1287,7 @@ create_index_paths(Query *root,
if (!(join_clause_p((Node *) clauseinfo->clause) &&
equal_path_merge_ordering(index->ordering,
clauseinfo->mergesortorder)))
{
temp = false;
}
}
if (!join || temp)

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.5 1997/09/08 21:44:59 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.6 1998/06/15 19:28:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -180,9 +180,7 @@ find_all_join_paths(Query *root, List *joinrels)
* wierd behavior.
*/
if (IsA_JoinPath(path))
{
((Path *) lfirst(path))->outerjoincost = (Cost) 0;
}
/*
* do it iff it is a join path, which is not always true, esp
@@ -354,9 +352,7 @@ match_unsorted_outer(Rel *joinrel,
}
if (xmergeinfo)
{
clauses = xmergeinfo->jmethod.clauses;
}
if (clauses)
{
@@ -374,19 +370,13 @@ match_unsorted_outer(Rel *joinrel,
joinrel->targetlist, clauses);
}
else
{
merge_pathkeys = outerpath->keys;
}
if (best_innerjoin &&
path_is_cheaper(best_innerjoin, cheapest_inner))
{
nestinnerpath = best_innerjoin;
}
else
{
nestinnerpath = cheapest_inner;
}
paths = lcons(create_nestloop_path(joinrel,
outerrel,
@@ -429,13 +419,9 @@ match_unsorted_outer(Rel *joinrel,
* wouldn't otherwise be considered.
*/
if (path_is_cheaper_than_sort)
{
mergeinnerpath->outerjoincost = outerpath->path_cost;
}
else
{
mergeinnerpath = cheapest_inner;
}
temp_node =
lcons(create_mergesort_path(joinrel,
@@ -453,9 +439,7 @@ match_unsorted_outer(Rel *joinrel,
paths);
}
else
{
temp_node = paths;
}
jp_list = nconc(jp_list, temp_node);
}
return (jp_list);
@@ -518,9 +502,7 @@ match_unsorted_inner(Rel *joinrel,
}
if (xmergeinfo)
{
clauses = ((JoinMethod *) xmergeinfo)->clauses;
}
if (clauses)
{

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.9 1998/03/30 16:46:45 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.10 1998/06/15 19:28:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -138,9 +138,7 @@ find_clause_joins(Query *root, Rel *outer_rel, List *joininfo_list)
joininfo);
}
else
{
rel = NULL;
}
if (rel != NULL)
join_list = lappend(join_list, rel);

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/joinutils.c,v 1.5 1998/02/26 04:32:40 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/joinutils.c,v 1.6 1998/06/15 19:28:41 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -106,16 +106,12 @@ match_pathkeys_joinkeys(List *pathkeys,
joinkeys = LispRemove(xjoinkey, joinkeys);
}
else
{
return (NIL);
}
}
if (matched_joinkeys == NULL ||
length(matched_joinkeys) != length(pathkeys))
{
return NIL;
}
*matchedJoinClausesPtr = nreverse(matched_joinclauses);
return (nreverse(matched_joinkeys));
@@ -239,9 +235,7 @@ match_paths_joinkeys(List *joinkeys,
matched_path = path;
}
else
{
matched_path = path;
}
}
}
return matched_path;
@@ -341,9 +335,7 @@ new_join_pathkeys(List *outer_pathkeys,
x = new_join_pathkey(outer_pathkey, NIL,
join_rel_tlist, joinclauses);
if (x != NIL)
{
t_list = lappend(t_list, x);
}
}
return (t_list);
}
@@ -396,9 +388,7 @@ new_join_pathkey(List *subkeys,
matched_subkeys);
}
else
{
newly_considered_subkeys = matched_subkeys;
}
considered_subkeys =
append(considered_subkeys, newly_considered_subkeys);

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/orindxpath.c,v 1.5 1998/02/26 04:32:41 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/orindxpath.c,v 1.6 1998/06/15 19:28:41 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -128,9 +128,7 @@ create_or_index_paths(Query *root,
create_or_index_paths(root, rel, lnext(clauses)));
}
else
{
t_list = create_or_index_paths(root, rel, lnext(clauses));
}
}
}
@@ -237,21 +235,13 @@ best_or_subclause_index(Query *root,
Cost subclause_selec;
if (constant_on_right)
{
value = ((Const *) get_rightop(subclause))->constvalue;
}
else
{
value = NameGetDatum("");
}
if (constant_on_right)
{
flag = (_SELEC_IS_CONSTANT_ || _SELEC_CONSTANT_RIGHT_);
}
else
{
flag = _SELEC_CONSTANT_RIGHT_;
}
index_selectivity(lfirsti(index->relids),
index->classlist,
lconsi(opno, NIL),

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/predmig.c,v 1.10 1998/03/30 16:46:55 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/predmig.c,v 1.11 1998/06/15 19:28:41 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -444,9 +444,7 @@ xfunc_form_groups(Query *queryInfo, Stream root, Stream bottom)
primjoin, NIL));
}
else
{
set_groupsel(temp, 1.0);
}
}
else
/* a restriction, or 2-ary join pred */

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.13 1998/04/02 07:27:15 vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.14 1998/06/15 19:28:41 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -75,9 +75,7 @@ prune_joinrel(Rel *rel, List *other_rels)
other_rel->pathlist);
}
else
{
result = nconc(result, lcons(other_rel, NIL));
}
}
return (result);
}
@@ -110,15 +108,11 @@ prune_rel_paths(List *rel_list)
path = (Path *) lfirst(y);
if (!path->p_ordering.ord.sortop)
{
break;
}
}
cheapest = (JoinPath *) prune_rel_path(rel, path);
if (IsA_JoinPath(cheapest))
{
rel->size = compute_joinrel_size(cheapest);
}
else
elog(ERROR, "non JoinPath called");
}
@@ -149,9 +143,7 @@ prune_rel_path(Rel *rel, Path *unorderedpath)
rel->pathlist = lremove(unorderedpath, rel->pathlist);
}
else
{
rel->unorderedpath = (Path *) unorderedpath;
}
return (cheapest);
}

View File

@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.14 1998/06/15 18:39:26 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.15 1998/06/15 19:28:42 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -335,13 +335,9 @@ xfunc_pullup(Query *queryInfo,
(LispValue) get_locclauseinfo(parentpath)));
/* put new childpath into the path tree */
if (whichchild == INNER)
{
set_innerjoinpath(parentpath, (pathPtr) newkid);
}
else
{
set_outerjoinpath(parentpath, (pathPtr) newkid);
}
/*
* * recompute parentpath cost from scratch -- the cost * of the join
@@ -497,9 +493,7 @@ xfunc_func_expense(LispValue node, LispValue args)
elog(ERROR, "Oper's function is undefined");
}
else
{
funcid = get_funcid((Func) node);
}
/* look up tuple in cache */
tupl = SearchSysCacheTuple(PROOID, ObjectIdGetDatum(funcid), 0, 0, 0);
@@ -1188,9 +1182,7 @@ xfunc_fixvars(LispValue clause, /* clause being pulled up */
tmpclause = lnext(tmpclause))
xfunc_fixvars(lfirst(tmpclause), rel, varno);
else
{
elog(ERROR, "Clause node of undetermined type");
}
}
@@ -1411,9 +1403,7 @@ xfunc_LispRemove(LispValue foo, List bar)
for (temp = bar; !null(temp); temp = lnext(temp))
if (!equal((Node) (foo), (Node) (lfirst(temp))))
{
result = lappend(result, lfirst(temp));
}
else
sanity = true; /* found a matching item to remove! */
@@ -1444,9 +1434,7 @@ xfunc_copyrel(Rel from, Rel *to)
/* COPY_CHECKARGS() */
if (to == NULL)
{
return false;
}
/* COPY_CHECKNULL() */
if (from == NULL)
@@ -1458,9 +1446,7 @@ xfunc_copyrel(Rel from, Rel *to)
/* COPY_NEW(c) */
newnode = (Rel) (*alloc) (classSize(Rel));
if (newnode == NULL)
{
return false;
}
/* ----------------
* copy node superclass fields