Commit 9dbb0efb authored by Bruce Momjian's avatar Bruce Momjian

Optmizer cleanup

parent d5a785cd
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.28 1999/02/10 03:52:35 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.29 1999/02/10 21:02:33 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -305,7 +305,7 @@ _equalRestrictInfo(RestrictInfo * a, RestrictInfo * b) ...@@ -305,7 +305,7 @@ _equalRestrictInfo(RestrictInfo * a, RestrictInfo * b)
* RelOptInfo is a subclass of Node. * RelOptInfo is a subclass of Node.
*/ */
static bool static bool
_equalRelOptInfo(RelOptInfo * a, RelOptInfo * b) _equalRelOptInfo(RelOptInfo *a, RelOptInfo *b)
{ {
Assert(IsA(a, RelOptInfo)); Assert(IsA(a, RelOptInfo));
Assert(IsA(b, RelOptInfo)); Assert(IsA(b, RelOptInfo));
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/Attic/freefuncs.c,v 1.5 1999/02/10 03:52:35 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/nodes/Attic/freefuncs.c,v 1.6 1999/02/10 21:02:33 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -714,7 +714,7 @@ _freeArrayRef(ArrayRef *node) ...@@ -714,7 +714,7 @@ _freeArrayRef(ArrayRef *node)
* ---------------- * ----------------
*/ */
static void static void
_freeRelOptInfo(RelOptInfo * node) _freeRelOptInfo(RelOptInfo *node)
{ {
/* ---------------- /* ----------------
* free remainder of node * free remainder of node
......
...@@ -5,7 +5,7 @@ ...@@ -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.26 1999/02/03 21:16:19 momjian Exp $ * $Id: geqo_eval.c,v 1.27 1999/02/10 21:02:34 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -50,12 +50,12 @@ ...@@ -50,12 +50,12 @@
#include "optimizer/geqo_paths.h" #include "optimizer/geqo_paths.h"
static List *gimme_clause_joins(Query *root, RelOptInfo * outer_rel, RelOptInfo * inner_rel); static List *gimme_clause_joins(Query *root, RelOptInfo *outer_rel, RelOptInfo *inner_rel);
static RelOptInfo *gimme_clauseless_join(RelOptInfo * outer_rel, RelOptInfo * inner_rel); static RelOptInfo *gimme_clauseless_join(RelOptInfo *outer_rel, RelOptInfo *inner_rel);
static RelOptInfo *init_join_rel(RelOptInfo * outer_rel, RelOptInfo * inner_rel, JoinInfo * joininfo); static RelOptInfo *init_join_rel(RelOptInfo *outer_rel, RelOptInfo *inner_rel, JoinInfo * joininfo);
static List *new_join_tlist(List *tlist, List *other_relids, int first_resdomno); static List *new_join_tlist(List *tlist, List *other_relids, int first_resdomno);
static List *new_joininfo_list(List *joininfo_list, List *join_relids); static List *new_joininfo_list(List *joininfo_list, List *join_relids);
static void geqo_joinrel_size(RelOptInfo * joinrel, RelOptInfo * outer_rel, RelOptInfo * inner_rel); static void geqo_joinrel_size(RelOptInfo *joinrel, RelOptInfo *outer_rel, RelOptInfo *inner_rel);
static RelOptInfo *geqo_nth(int stop, List *rels); static RelOptInfo *geqo_nth(int stop, List *rels);
/* /*
...@@ -99,7 +99,7 @@ geqo_eval(Query *root, Gene *tour, int num_gene) ...@@ -99,7 +99,7 @@ geqo_eval(Query *root, Gene *tour, int num_gene)
* Returns a new join relation incorporating all joins in a left-sided tree. * Returns a new join relation incorporating all joins in a left-sided tree.
*/ */
RelOptInfo * RelOptInfo *
gimme_tree(Query *root, Gene *tour, int rel_count, int num_gene, RelOptInfo * outer_rel) gimme_tree(Query *root, Gene *tour, int rel_count, int num_gene, RelOptInfo *outer_rel)
{ {
RelOptInfo *inner_rel; /* current relation */ RelOptInfo *inner_rel; /* current relation */
int base_rel_index; int base_rel_index;
...@@ -189,7 +189,7 @@ gimme_tree(Query *root, Gene *tour, int rel_count, int num_gene, RelOptInfo * ou ...@@ -189,7 +189,7 @@ gimme_tree(Query *root, Gene *tour, int rel_count, int num_gene, RelOptInfo * ou
*/ */
static List * static List *
gimme_clause_joins(Query *root, RelOptInfo * outer_rel, RelOptInfo * inner_rel) gimme_clause_joins(Query *root, RelOptInfo *outer_rel, RelOptInfo *inner_rel)
{ {
List *join_list = NIL; List *join_list = NIL;
List *i = NIL; List *i = NIL;
...@@ -240,7 +240,7 @@ gimme_clause_joins(Query *root, RelOptInfo * outer_rel, RelOptInfo * inner_rel) ...@@ -240,7 +240,7 @@ gimme_clause_joins(Query *root, RelOptInfo * outer_rel, RelOptInfo * inner_rel)
*/ */
static RelOptInfo * static RelOptInfo *
gimme_clauseless_join(RelOptInfo * outer_rel, RelOptInfo * inner_rel) gimme_clauseless_join(RelOptInfo *outer_rel, RelOptInfo *inner_rel)
{ {
return init_join_rel(outer_rel, inner_rel, (JoinInfo *) NULL); return init_join_rel(outer_rel, inner_rel, (JoinInfo *) NULL);
} }
...@@ -257,7 +257,7 @@ gimme_clauseless_join(RelOptInfo * outer_rel, RelOptInfo * inner_rel) ...@@ -257,7 +257,7 @@ gimme_clauseless_join(RelOptInfo * outer_rel, RelOptInfo * inner_rel)
* Returns the new join relation node. * Returns the new join relation node.
*/ */
static RelOptInfo * static RelOptInfo *
init_join_rel(RelOptInfo * outer_rel, RelOptInfo * inner_rel, JoinInfo * joininfo) init_join_rel(RelOptInfo *outer_rel, RelOptInfo *inner_rel, JoinInfo * joininfo)
{ {
RelOptInfo *joinrel = makeNode(RelOptInfo); RelOptInfo *joinrel = makeNode(RelOptInfo);
List *joinrel_joininfo_list = NIL; List *joinrel_joininfo_list = NIL;
...@@ -635,7 +635,7 @@ geqo_final_join_rels(List *join_rel_list) ...@@ -635,7 +635,7 @@ geqo_final_join_rels(List *join_rel_list)
* Modifies the superrels field of rel * Modifies the superrels field of rel
*/ */
static void static void
add_superrels(RelOptInfo * rel, RelOptInfo * super_rel) add_superrels(RelOptInfo *rel, RelOptInfo *super_rel)
{ {
rel->superrels = lappend(rel->superrels, super_rel); rel->superrels = lappend(rel->superrels, super_rel);
} }
...@@ -650,7 +650,7 @@ add_superrels(RelOptInfo * rel, RelOptInfo * super_rel) ...@@ -650,7 +650,7 @@ add_superrels(RelOptInfo * rel, RelOptInfo * super_rel)
* Returns non-nil if rel1 and rel2 do not overlap. * Returns non-nil if rel1 and rel2 do not overlap.
*/ */
static bool static bool
nonoverlap_rels(RelOptInfo * rel1, RelOptInfo * rel2) nonoverlap_rels(RelOptInfo *rel1, RelOptInfo *rel2)
{ {
return nonoverlap_sets(rel1->relids, rel2->relids); return nonoverlap_sets(rel1->relids, rel2->relids);
} }
...@@ -678,7 +678,7 @@ nonoverlap_sets(List *s1, List *s2) ...@@ -678,7 +678,7 @@ nonoverlap_sets(List *s1, List *s2)
* long join queries; so get logarithm of size when MAXINT overflow; * long join queries; so get logarithm of size when MAXINT overflow;
*/ */
static void static void
geqo_joinrel_size(RelOptInfo * joinrel, RelOptInfo * outer_rel, RelOptInfo * inner_rel) geqo_joinrel_size(RelOptInfo *joinrel, RelOptInfo *outer_rel, RelOptInfo *inner_rel)
{ {
Cost temp; Cost temp;
int ntuples; int ntuples;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* $Id: geqo_misc.c,v 1.13 1999/02/10 03:52:37 momjian Exp $ * $Id: geqo_misc.c,v 1.14 1999/02/10 21:02:34 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -262,7 +262,7 @@ geqo_print_path(Query *root, Path *path, int indent) ...@@ -262,7 +262,7 @@ geqo_print_path(Query *root, Path *path, int indent)
} }
void void
geqo_print_rel(Query *root, RelOptInfo * rel) geqo_print_rel(Query *root, RelOptInfo *rel)
{ {
List *l; List *l;
......
...@@ -5,7 +5,7 @@ ...@@ -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.14 1999/02/09 03:51:15 momjian Exp $ * $Id: geqo_paths.c,v 1.15 1999/02/10 21:02:35 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
#include "optimizer/geqo_paths.h" #include "optimizer/geqo_paths.h"
static List *geqo_prune_rel(RelOptInfo * rel, List *other_rels); static List *geqo_prune_rel(RelOptInfo *rel, List *other_rels);
static Path *set_paths(RelOptInfo * rel, Path *unorderedpath); static Path *set_paths(RelOptInfo *rel, Path *unorderedpath);
/* /*
* geqo-prune-rels-- * geqo-prune-rels--
...@@ -65,7 +65,7 @@ geqo_prune_rels(List *rel_list) ...@@ -65,7 +65,7 @@ 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 *i = NIL;
List *t_list = NIL; List *t_list = NIL;
...@@ -102,7 +102,7 @@ geqo_prune_rel(RelOptInfo * rel, List *other_rels) ...@@ -102,7 +102,7 @@ geqo_prune_rel(RelOptInfo * rel, List *other_rels)
* *
*/ */
void void
geqo_rel_paths(RelOptInfo * rel) geqo_rel_paths(RelOptInfo *rel)
{ {
List *y = NIL; List *y = NIL;
Path *path = (Path *) NULL; Path *path = (Path *) NULL;
...@@ -134,7 +134,7 @@ geqo_rel_paths(RelOptInfo * rel) ...@@ -134,7 +134,7 @@ geqo_rel_paths(RelOptInfo * rel)
* *
*/ */
static Path * static Path *
set_paths(RelOptInfo * rel, Path *unorderedpath) set_paths(RelOptInfo *rel, Path *unorderedpath)
{ {
Path *cheapest = set_cheapest(rel, rel->pathlist); Path *cheapest = set_cheapest(rel, rel->pathlist);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/geqo/Attic/minspantree.c,v 1.8 1998/09/01 04:29:24 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/geqo/Attic/minspantree.c,v 1.9 1999/02/10 21:02:35 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
*/ */
void void
minspantree(Query *root, List *join_rels, RelOptInfo * garel) minspantree(Query *root, List *join_rels, RelOptInfo *garel)
{ {
int number_of_rels = length(root->base_rel_list); int number_of_rels = length(root->base_rel_list);
int number_of_joins = length(join_rels); int number_of_joins = length(join_rels);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.26 1999/02/10 03:52:38 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.27 1999/02/10 21:02:36 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -47,7 +47,7 @@ static void find_rel_paths(Query *root, List *rels); ...@@ -47,7 +47,7 @@ static void find_rel_paths(Query *root, List *rels);
static List *find_join_paths(Query *root, List *outer_rels, int levels_needed); static List *find_join_paths(Query *root, List *outer_rels, int levels_needed);
#ifdef OPTIMIZER_DEBUG #ifdef OPTIMIZER_DEBUG
static void debug_print_rel(Query *root, RelOptInfo * rel); static void debug_print_rel(Query *root, RelOptInfo *rel);
#endif #endif
...@@ -405,7 +405,7 @@ print_path(Query *root, Path *path, int indent) ...@@ -405,7 +405,7 @@ print_path(Query *root, Path *path, int indent)
} }
static void static void
debug_print_rel(Query *root, RelOptInfo * rel) debug_print_rel(Query *root, RelOptInfo *rel)
{ {
List *l; List *l;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.28 1999/02/10 03:52:39 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.29 1999/02/10 21:02:37 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -360,7 +360,7 @@ cost_hashjoin(Cost outercost, ...@@ -360,7 +360,7 @@ cost_hashjoin(Cost outercost,
* Returns the size. * Returns the size.
*/ */
int int
compute_rel_size(RelOptInfo * rel) compute_rel_size(RelOptInfo *rel)
{ {
Cost temp; Cost temp;
int temp1; int temp1;
...@@ -383,7 +383,7 @@ compute_rel_size(RelOptInfo * rel) ...@@ -383,7 +383,7 @@ compute_rel_size(RelOptInfo * rel)
* Returns the width of the tuple as a fixnum. * Returns the width of the tuple as a fixnum.
*/ */
int int
compute_rel_width(RelOptInfo * rel) compute_rel_width(RelOptInfo *rel)
{ {
return compute_targetlist_width(get_actual_tlist(rel->targetlist)); return compute_targetlist_width(get_actual_tlist(rel->targetlist));
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.41 1999/02/10 03:52:39 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.42 1999/02/10 21:02:38 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -45,17 +45,17 @@ ...@@ -45,17 +45,17 @@
#include "utils/lsyscache.h" #include "utils/lsyscache.h"
static void match_index_orclauses(RelOptInfo * rel, RelOptInfo * index, int indexkey, static void match_index_orclauses(RelOptInfo *rel, RelOptInfo *index, int indexkey,
int xclass, List *restrictinfo_list); int xclass, List *restrictinfo_list);
static bool match_index_to_operand(int indexkey, Expr *operand, static bool match_index_to_operand(int indexkey, Expr *operand,
RelOptInfo * rel, RelOptInfo * index); RelOptInfo *rel, RelOptInfo *index);
static List *match_index_orclause(RelOptInfo * rel, RelOptInfo * index, int indexkey, static List *match_index_orclause(RelOptInfo *rel, RelOptInfo *index, int indexkey,
int xclass, List *or_clauses, List *other_matching_indices); int xclass, List *or_clauses, List *other_matching_indices);
static List *group_clauses_by_indexkey(RelOptInfo * rel, RelOptInfo * index, static List *group_clauses_by_indexkey(RelOptInfo *rel, RelOptInfo *index,
int *indexkeys, Oid *classes, List *restrictinfo_list); int *indexkeys, Oid *classes, List *restrictinfo_list);
static List *group_clauses_by_ikey_for_joins(RelOptInfo * rel, RelOptInfo * index, static List *group_clauses_by_ikey_for_joins(RelOptInfo *rel, RelOptInfo *index,
int *indexkeys, Oid *classes, List *join_cinfo_list, List *restr_cinfo_list); int *indexkeys, Oid *classes, List *join_cinfo_list, List *restr_cinfo_list);
static RestrictInfo *match_clause_to_indexkey(RelOptInfo * rel, RelOptInfo * index, int indexkey, static RestrictInfo *match_clause_to_indexkey(RelOptInfo *rel, RelOptInfo *index, int indexkey,
int xclass, RestrictInfo * restrictInfo, bool join); int xclass, RestrictInfo * restrictInfo, bool join);
static bool pred_test(List *predicate_list, List *restrictinfo_list, static bool pred_test(List *predicate_list, List *restrictinfo_list,
List *joininfo_list); List *joininfo_list);
...@@ -63,14 +63,14 @@ static bool one_pred_test(Expr *predicate, List *restrictinfo_list); ...@@ -63,14 +63,14 @@ static bool one_pred_test(Expr *predicate, List *restrictinfo_list);
static bool one_pred_clause_expr_test(Expr *predicate, Node *clause); static bool one_pred_clause_expr_test(Expr *predicate, Node *clause);
static bool one_pred_clause_test(Expr *predicate, Node *clause); static bool one_pred_clause_test(Expr *predicate, Node *clause);
static bool clause_pred_clause_test(Expr *predicate, Node *clause); static bool clause_pred_clause_test(Expr *predicate, Node *clause);
static List *indexable_joinclauses(RelOptInfo * rel, RelOptInfo * index, static List *indexable_joinclauses(RelOptInfo *rel, RelOptInfo *index,
List *joininfo_list, List *restrictinfo_list); List *joininfo_list, List *restrictinfo_list);
static List *index_innerjoin(Query *root, RelOptInfo * rel, static List *index_innerjoin(Query *root, RelOptInfo *rel,
List *clausegroup_list, RelOptInfo * index); List *clausegroup_list, RelOptInfo *index);
static List *create_index_paths(Query *root, RelOptInfo * rel, RelOptInfo * index, static List *create_index_paths(Query *root, RelOptInfo *rel, RelOptInfo *index,
List *clausegroup_list, bool join); List *clausegroup_list, bool join);
static List *add_index_paths(List *indexpaths, List *new_indexpaths); static List *add_index_paths(List *indexpaths, List *new_indexpaths);
static bool function_index_operand(Expr *funcOpnd, RelOptInfo * rel, RelOptInfo * index); static bool function_index_operand(Expr *funcOpnd, RelOptInfo *rel, RelOptInfo *index);
/* find_index_paths() /* find_index_paths()
...@@ -100,7 +100,7 @@ static bool function_index_operand(Expr *funcOpnd, RelOptInfo * rel, RelOptInfo ...@@ -100,7 +100,7 @@ static bool function_index_operand(Expr *funcOpnd, RelOptInfo * rel, RelOptInfo
*/ */
List * List *
find_index_paths(Query *root, find_index_paths(Query *root,
RelOptInfo * rel, RelOptInfo *rel,
List *indices, List *indices,
List *restrictinfo_list, List *restrictinfo_list,
List *joininfo_list) List *joininfo_list)
...@@ -218,8 +218,8 @@ find_index_paths(Query *root, ...@@ -218,8 +218,8 @@ find_index_paths(Query *root,
* *
*/ */
static void static void
match_index_orclauses(RelOptInfo * rel, match_index_orclauses(RelOptInfo *rel,
RelOptInfo * index, RelOptInfo *index,
int indexkey, int indexkey,
int xclass, int xclass,
List *restrictinfo_list) List *restrictinfo_list)
...@@ -254,8 +254,8 @@ match_index_orclauses(RelOptInfo * rel, ...@@ -254,8 +254,8 @@ match_index_orclauses(RelOptInfo * rel,
static bool static bool
match_index_to_operand(int indexkey, match_index_to_operand(int indexkey,
Expr *operand, Expr *operand,
RelOptInfo * rel, RelOptInfo *rel,
RelOptInfo * index) RelOptInfo *index)
{ {
bool result; bool result;
...@@ -297,8 +297,8 @@ match_index_to_operand(int indexkey, ...@@ -297,8 +297,8 @@ match_index_to_operand(int indexkey,
* match the third, g,h match the fourth, etc. * match the third, g,h match the fourth, etc.
*/ */
static List * static List *
match_index_orclause(RelOptInfo * rel, match_index_orclause(RelOptInfo *rel,
RelOptInfo * index, RelOptInfo *index,
int indexkey, int indexkey,
int xclass, int xclass,
List *or_clauses, List *or_clauses,
...@@ -387,8 +387,8 @@ match_index_orclause(RelOptInfo * rel, ...@@ -387,8 +387,8 @@ match_index_orclause(RelOptInfo * rel,
* *
*/ */
static List * static List *
group_clauses_by_indexkey(RelOptInfo * rel, group_clauses_by_indexkey(RelOptInfo *rel,
RelOptInfo * index, RelOptInfo *index,
int *indexkeys, int *indexkeys,
Oid *classes, Oid *classes,
List *restrictinfo_list) List *restrictinfo_list)
...@@ -449,8 +449,8 @@ group_clauses_by_indexkey(RelOptInfo * rel, ...@@ -449,8 +449,8 @@ group_clauses_by_indexkey(RelOptInfo * rel,
* *
*/ */
static List * static List *
group_clauses_by_ikey_for_joins(RelOptInfo * rel, group_clauses_by_ikey_for_joins(RelOptInfo *rel,
RelOptInfo * index, RelOptInfo *index,
int *indexkeys, int *indexkeys,
Oid *classes, Oid *classes,
List *join_cinfo_list, List *join_cinfo_list,
...@@ -1183,7 +1183,7 @@ clause_pred_clause_test(Expr *predicate, Node *clause) ...@@ -1183,7 +1183,7 @@ clause_pred_clause_test(Expr *predicate, Node *clause)
* *
*/ */
static List * static List *
indexable_joinclauses(RelOptInfo * rel, RelOptInfo * index, indexable_joinclauses(RelOptInfo *rel, RelOptInfo *index,
List *joininfo_list, List *restrictinfo_list) List *joininfo_list, List *restrictinfo_list)
{ {
JoinInfo *joininfo = (JoinInfo *) NULL; JoinInfo *joininfo = (JoinInfo *) NULL;
...@@ -1255,8 +1255,8 @@ extract_restrict_clauses(List *clausegroup) ...@@ -1255,8 +1255,8 @@ extract_restrict_clauses(List *clausegroup)
* *
*/ */
static List * static List *
index_innerjoin(Query *root, RelOptInfo * rel, List *clausegroup_list, index_innerjoin(Query *root, RelOptInfo *rel, List *clausegroup_list,
RelOptInfo * index) RelOptInfo *index)
{ {
List *clausegroup = NIL; List *clausegroup = NIL;
List *cg_list = NIL; List *cg_list = NIL;
...@@ -1345,8 +1345,8 @@ index_innerjoin(Query *root, RelOptInfo * rel, List *clausegroup_list, ...@@ -1345,8 +1345,8 @@ index_innerjoin(Query *root, RelOptInfo * rel, List *clausegroup_list,
*/ */
static List * static List *
create_index_paths(Query *root, create_index_paths(Query *root,
RelOptInfo * rel, RelOptInfo *rel,
RelOptInfo * index, RelOptInfo *index,
List *clausegroup_list, List *clausegroup_list,
bool join) bool join)
{ {
...@@ -1390,7 +1390,7 @@ add_index_paths(List *indexpaths, List *new_indexpaths) ...@@ -1390,7 +1390,7 @@ add_index_paths(List *indexpaths, List *new_indexpaths)
} }
static bool static bool
function_index_operand(Expr *funcOpnd, RelOptInfo * rel, RelOptInfo * index) function_index_operand(Expr *funcOpnd, RelOptInfo *rel, RelOptInfo *index)
{ {
Oid heapRelid = (Oid) lfirsti(rel->relids); Oid heapRelid = (Oid) lfirsti(rel->relids);
Func *function; Func *function;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.18 1999/02/10 17:14:30 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.19 1999/02/10 21:02:38 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -30,15 +30,15 @@ ...@@ -30,15 +30,15 @@
* _enable_mergejoin} */ * _enable_mergejoin} */
static Path *best_innerjoin(List *join_paths, List *outer_relid); static Path *best_innerjoin(List *join_paths, List *outer_relid);
static List *sort_inner_and_outer(RelOptInfo * joinrel, RelOptInfo * outerrel, RelOptInfo * innerrel, static List *sort_inner_and_outer(RelOptInfo *joinrel, RelOptInfo *outerrel, RelOptInfo *innerrel,
List *mergeinfo_list); List *mergeinfo_list);
static List *match_unsorted_outer(RelOptInfo * joinrel, RelOptInfo * outerrel, RelOptInfo * innerrel, static List *match_unsorted_outer(RelOptInfo *joinrel, RelOptInfo *outerrel, RelOptInfo *innerrel,
List *outerpath_list, Path *cheapest_inner, Path *best_innerjoin, List *outerpath_list, Path *cheapest_inner, Path *best_innerjoin,
List *mergeinfo_list); List *mergeinfo_list);
static List *match_unsorted_inner(RelOptInfo * joinrel, RelOptInfo * outerrel, RelOptInfo * innerrel, static List *match_unsorted_inner(RelOptInfo *joinrel, RelOptInfo *outerrel, RelOptInfo *innerrel,
List *innerpath_list, List *mergeinfo_list); List *innerpath_list, List *mergeinfo_list);
static bool EnoughMemoryForHashjoin(RelOptInfo * hashrel); static bool EnoughMemoryForHashjoin(RelOptInfo *hashrel);
static List *hash_inner_and_outer(RelOptInfo * joinrel, RelOptInfo * outerrel, RelOptInfo * innerrel, static List *hash_inner_and_outer(RelOptInfo *joinrel, RelOptInfo *outerrel, RelOptInfo *innerrel,
List *hashinfo_list); List *hashinfo_list);
/* /*
...@@ -59,7 +59,6 @@ static List *hash_inner_and_outer(RelOptInfo * joinrel, RelOptInfo * outerrel, R ...@@ -59,7 +59,6 @@ static List *hash_inner_and_outer(RelOptInfo * joinrel, RelOptInfo * outerrel, R
* If bushy trees are considered, may modify the relid field of the * If bushy trees are considered, may modify the relid field of the
* join rel nodes to flatten the lists. * join rel nodes to flatten the lists.
* *
* Returns nothing of interest. (?)
* It does a destructive modification. * It does a destructive modification.
*/ */
void void
...@@ -228,9 +227,9 @@ best_innerjoin(List *join_paths, List *outer_relids) ...@@ -228,9 +227,9 @@ best_innerjoin(List *join_paths, List *outer_relids)
* Returns a list of mergejoin paths. * Returns a list of mergejoin paths.
*/ */
static List * static List *
sort_inner_and_outer(RelOptInfo * joinrel, sort_inner_and_outer(RelOptInfo *joinrel,
RelOptInfo * outerrel, RelOptInfo *outerrel,
RelOptInfo * innerrel, RelOptInfo *innerrel,
List *mergeinfo_list) List *mergeinfo_list)
{ {
List *ms_list = NIL; List *ms_list = NIL;
...@@ -302,9 +301,9 @@ sort_inner_and_outer(RelOptInfo * joinrel, ...@@ -302,9 +301,9 @@ sort_inner_and_outer(RelOptInfo * joinrel,
* Returns a list of possible join path nodes. * Returns a list of possible join path nodes.
*/ */
static List * static List *
match_unsorted_outer(RelOptInfo * joinrel, match_unsorted_outer(RelOptInfo *joinrel,
RelOptInfo * outerrel, RelOptInfo *outerrel,
RelOptInfo * innerrel, RelOptInfo *innerrel,
List *outerpath_list, List *outerpath_list,
Path *cheapest_inner, Path *cheapest_inner,
Path *best_innerjoin, Path *best_innerjoin,
...@@ -448,9 +447,9 @@ match_unsorted_outer(RelOptInfo * joinrel, ...@@ -448,9 +447,9 @@ match_unsorted_outer(RelOptInfo * joinrel,
* Returns a list of possible merge paths. * Returns a list of possible merge paths.
*/ */
static List * static List *
match_unsorted_inner(RelOptInfo * joinrel, match_unsorted_inner(RelOptInfo *joinrel,
RelOptInfo * outerrel, RelOptInfo *outerrel,
RelOptInfo * innerrel, RelOptInfo *innerrel,
List *innerpath_list, List *innerpath_list,
List *mergeinfo_list) List *mergeinfo_list)
{ {
...@@ -539,7 +538,7 @@ match_unsorted_inner(RelOptInfo * joinrel, ...@@ -539,7 +538,7 @@ match_unsorted_inner(RelOptInfo * joinrel,
} }
static bool static bool
EnoughMemoryForHashjoin(RelOptInfo * hashrel) EnoughMemoryForHashjoin(RelOptInfo *hashrel)
{ {
int ntuples; int ntuples;
int tupsize; int tupsize;
...@@ -573,9 +572,9 @@ EnoughMemoryForHashjoin(RelOptInfo * hashrel) ...@@ -573,9 +572,9 @@ EnoughMemoryForHashjoin(RelOptInfo * hashrel)
* Returns a list of hashjoin paths. * Returns a list of hashjoin paths.
*/ */
static List * static List *
hash_inner_and_outer(RelOptInfo * joinrel, hash_inner_and_outer(RelOptInfo *joinrel,
RelOptInfo * outerrel, RelOptInfo *outerrel,
RelOptInfo * innerrel, RelOptInfo *innerrel,
List *hashinfo_list) List *hashinfo_list)
{ {
HashInfo *xhashinfo = (HashInfo *) NULL; HashInfo *xhashinfo = (HashInfo *) NULL;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.17 1999/02/03 21:16:27 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.18 1999/02/10 21:02:39 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -31,16 +31,16 @@ bool _use_right_sided_plans_ = false; ...@@ -31,16 +31,16 @@ bool _use_right_sided_plans_ = false;
#endif #endif
static List *find_clause_joins(Query *root, RelOptInfo * outer_rel, List *joininfo_list); static List *find_clause_joins(Query *root, RelOptInfo *outer_rel, List *joininfo_list);
static List *find_clauseless_joins(RelOptInfo * outer_rel, List *inner_rels); static List *find_clauseless_joins(RelOptInfo *outer_rel, List *inner_rels);
static RelOptInfo *init_join_rel(RelOptInfo * outer_rel, RelOptInfo * inner_rel, JoinInfo * joininfo); static RelOptInfo *init_join_rel(RelOptInfo *outer_rel, RelOptInfo *inner_rel, JoinInfo * joininfo);
static List *new_join_tlist(List *tlist, List *other_relids, static List *new_join_tlist(List *tlist, List *other_relids,
int first_resdomno); int first_resdomno);
static List *new_joininfo_list(List *joininfo_list, List *join_relids); static List *new_joininfo_list(List *joininfo_list, List *join_relids);
static void add_superrels(RelOptInfo * rel, RelOptInfo * super_rel); static void add_superrels(RelOptInfo *rel, RelOptInfo *super_rel);
static bool nonoverlap_rels(RelOptInfo * rel1, RelOptInfo * rel2); static bool nonoverlap_rels(RelOptInfo *rel1, RelOptInfo *rel2);
static bool nonoverlap_sets(List *s1, List *s2); static bool nonoverlap_sets(List *s1, List *s2);
static void set_joinrel_size(RelOptInfo * joinrel, RelOptInfo * outer_rel, RelOptInfo * inner_rel, static void set_joinrel_size(RelOptInfo *joinrel, RelOptInfo *outer_rel, RelOptInfo *inner_rel,
JoinInfo * jinfo); JoinInfo * jinfo);
/* /*
...@@ -97,7 +97,7 @@ find_join_rels(Query *root, List *outer_rels) ...@@ -97,7 +97,7 @@ find_join_rels(Query *root, List *outer_rels)
* Returns a list of new join relations. * Returns a list of new join relations.
*/ */
static List * static List *
find_clause_joins(Query *root, RelOptInfo * outer_rel, List *joininfo_list) find_clause_joins(Query *root, RelOptInfo *outer_rel, List *joininfo_list)
{ {
List *join_list = NIL; List *join_list = NIL;
List *i = NIL; List *i = NIL;
...@@ -156,7 +156,7 @@ find_clause_joins(Query *root, RelOptInfo * outer_rel, List *joininfo_list) ...@@ -156,7 +156,7 @@ find_clause_joins(Query *root, RelOptInfo * outer_rel, List *joininfo_list)
* Returns a list of new join relations. * Returns a list of new join relations.
*/ */
static List * static List *
find_clauseless_joins(RelOptInfo * outer_rel, List *inner_rels) find_clauseless_joins(RelOptInfo *outer_rel, List *inner_rels)
{ {
RelOptInfo *inner_rel; RelOptInfo *inner_rel;
List *t_list = NIL; List *t_list = NIL;
...@@ -191,7 +191,7 @@ find_clauseless_joins(RelOptInfo * outer_rel, List *inner_rels) ...@@ -191,7 +191,7 @@ find_clauseless_joins(RelOptInfo * outer_rel, List *inner_rels)
* Returns the new join relation node. * Returns the new join relation node.
*/ */
static RelOptInfo * static RelOptInfo *
init_join_rel(RelOptInfo * outer_rel, RelOptInfo * inner_rel, JoinInfo * joininfo) init_join_rel(RelOptInfo *outer_rel, RelOptInfo *inner_rel, JoinInfo * joininfo)
{ {
RelOptInfo *joinrel = makeNode(RelOptInfo); RelOptInfo *joinrel = makeNode(RelOptInfo);
List *joinrel_joininfo_list = NIL; List *joinrel_joininfo_list = NIL;
...@@ -518,7 +518,7 @@ final_join_rels(List *join_rel_list) ...@@ -518,7 +518,7 @@ final_join_rels(List *join_rel_list)
* Modifies the superrels field of rel * Modifies the superrels field of rel
*/ */
static void static void
add_superrels(RelOptInfo * rel, RelOptInfo * super_rel) add_superrels(RelOptInfo *rel, RelOptInfo *super_rel)
{ {
rel->superrels = lappend(rel->superrels, super_rel); rel->superrels = lappend(rel->superrels, super_rel);
} }
...@@ -533,7 +533,7 @@ add_superrels(RelOptInfo * rel, RelOptInfo * super_rel) ...@@ -533,7 +533,7 @@ add_superrels(RelOptInfo * rel, RelOptInfo * super_rel)
* Returns non-nil if rel1 and rel2 do not overlap. * Returns non-nil if rel1 and rel2 do not overlap.
*/ */
static bool static bool
nonoverlap_rels(RelOptInfo * rel1, RelOptInfo * rel2) nonoverlap_rels(RelOptInfo *rel1, RelOptInfo *rel2)
{ {
return nonoverlap_sets(rel1->relids, rel2->relids); return nonoverlap_sets(rel1->relids, rel2->relids);
} }
...@@ -554,7 +554,7 @@ nonoverlap_sets(List *s1, List *s2) ...@@ -554,7 +554,7 @@ nonoverlap_sets(List *s1, List *s2)
} }
static void static void
set_joinrel_size(RelOptInfo * joinrel, RelOptInfo * outer_rel, RelOptInfo * inner_rel, JoinInfo * jinfo) set_joinrel_size(RelOptInfo *joinrel, RelOptInfo *outer_rel, RelOptInfo *inner_rel, JoinInfo * jinfo)
{ {
int ntuples; int ntuples;
float selec; float selec;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/joinutils.c,v 1.15 1999/02/10 17:14:30 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/joinutils.c,v 1.16 1999/02/10 21:02:39 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -135,7 +135,7 @@ match_pathkey_joinkeys(List *pathkey, ...@@ -135,7 +135,7 @@ match_pathkey_joinkeys(List *pathkey,
{ {
jk = (JoinKey *) lfirst(x); jk = (JoinKey *) lfirst(x);
if (var_equal(path_subkey, if (var_equal(path_subkey,
extract_subkey(jk, which_subkey))) extract_join_subkey(jk, which_subkey)))
return pos; return pos;
pos++; pos++;
} }
...@@ -183,7 +183,7 @@ every_func(List *joinkeys, List *pathkey, int which_subkey) ...@@ -183,7 +183,7 @@ every_func(List *joinkeys, List *pathkey, int which_subkey)
temp = (Var *) lfirst((List *) lfirst(j)); temp = (Var *) lfirst((List *) lfirst(j));
if (temp == NULL) if (temp == NULL)
continue; continue;
tempkey = extract_subkey(xjoinkey, which_subkey); tempkey = extract_join_subkey(xjoinkey, which_subkey);
if (var_equal(tempkey, temp)) if (var_equal(tempkey, temp))
{ {
found = true; found = true;
...@@ -267,7 +267,7 @@ extract_path_keys(List *joinkeys, ...@@ -267,7 +267,7 @@ extract_path_keys(List *joinkeys,
/* /*
* find the right Var in the target list for this key * find the right Var in the target list for this key
*/ */
var = (Var *) extract_subkey(jkey, which_subkey); var = (Var *) extract_join_subkey(jkey, which_subkey);
key = (Var *) matching_tlvar(var, tlist); key = (Var *) matching_tlvar(var, tlist);
/* /*
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/orindxpath.c,v 1.17 1999/02/10 03:52:41 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/orindxpath.c,v 1.18 1999/02/10 21:02:39 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -32,10 +32,10 @@ ...@@ -32,10 +32,10 @@
static void static void
best_or_subclause_indices(Query *root, RelOptInfo * rel, List *subclauses, best_or_subclause_indices(Query *root, RelOptInfo *rel, List *subclauses,
List *indices, List *examined_indexids, Cost subcost, List *selectivities, List *indices, List *examined_indexids, Cost subcost, List *selectivities,
List **indexids, Cost *cost, List **selecs); List **indexids, Cost *cost, List **selecs);
static void best_or_subclause_index(Query *root, RelOptInfo * rel, Expr *subclause, static void best_or_subclause_index(Query *root, RelOptInfo *rel, Expr *subclause,
List *indices, int *indexid, Cost *cost, Cost *selec); List *indices, int *indexid, Cost *cost, Cost *selec);
...@@ -51,7 +51,7 @@ static void best_or_subclause_index(Query *root, RelOptInfo * rel, Expr *subclau ...@@ -51,7 +51,7 @@ static void best_or_subclause_index(Query *root, RelOptInfo * rel, Expr *subclau
*/ */
List * List *
create_or_index_paths(Query *root, create_or_index_paths(Query *root,
RelOptInfo * rel, List *clauses) RelOptInfo *rel, List *clauses)
{ {
List *t_list = NIL; List *t_list = NIL;
List *clist; List *clist;
...@@ -163,7 +163,7 @@ create_or_index_paths(Query *root, ...@@ -163,7 +163,7 @@ create_or_index_paths(Query *root,
*/ */
static void static void
best_or_subclause_indices(Query *root, best_or_subclause_indices(Query *root,
RelOptInfo * rel, RelOptInfo *rel,
List *subclauses, List *subclauses,
List *indices, List *indices,
List *examined_indexids, List *examined_indexids,
...@@ -214,7 +214,7 @@ best_or_subclause_indices(Query *root, ...@@ -214,7 +214,7 @@ best_or_subclause_indices(Query *root,
*/ */
static void static void
best_or_subclause_index(Query *root, best_or_subclause_index(Query *root,
RelOptInfo * rel, RelOptInfo *rel,
Expr *subclause, Expr *subclause,
List *indices, List *indices,
int *retIndexid, /* return value */ int *retIndexid, /* return value */
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.25 1999/02/09 03:51:21 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.26 1999/02/10 21:02:40 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "utils/elog.h" #include "utils/elog.h"
static List *prune_joinrel(RelOptInfo * rel, List *other_rels); static List *prune_joinrel(RelOptInfo *rel, List *other_rels);
/* /*
* prune-joinrels-- * prune-joinrels--
...@@ -132,7 +132,7 @@ prune_rel_paths(List *rel_list) ...@@ -132,7 +132,7 @@ prune_rel_paths(List *rel_list)
* *
*/ */
Path * Path *
prune_rel_path(RelOptInfo * rel, Path *unorderedpath) prune_rel_path(RelOptInfo *rel, Path *unorderedpath)
{ {
Path *cheapest = set_cheapest(rel, rel->pathlist); Path *cheapest = set_cheapest(rel, rel->pathlist);
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.24 1999/02/03 21:16:29 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.25 1999/02/10 21:02:40 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -1423,7 +1423,7 @@ do { \ ...@@ -1423,7 +1423,7 @@ do { \
** Just like _copyRel, but doesn't copy the paths ** Just like _copyRel, but doesn't copy the paths
*/ */
bool bool
xfunc_copyrel(RelOptInfo from, RelOptInfo * to) xfunc_copyrel(RelOptInfo from, RelOptInfo *to)
{ {
RelOptInfo newnode; RelOptInfo newnode;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/indexnode.c,v 1.11 1999/02/03 20:15:42 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/indexnode.c,v 1.12 1999/02/10 21:02:40 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -33,7 +33,7 @@ static List *find_secondary_index(Query *root, Oid relid); ...@@ -33,7 +33,7 @@ static List *find_secondary_index(Query *root, Oid relid);
* *
*/ */
List * List *
find_relation_indices(Query *root, RelOptInfo * rel) find_relation_indices(Query *root, RelOptInfo *rel)
{ {
if (rel->indexed) if (rel->indexed)
return find_secondary_index(root, lfirsti(rel->relids)); return find_secondary_index(root, lfirsti(rel->relids));
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/joininfo.c,v 1.13 1999/02/03 20:15:42 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/joininfo.c,v 1.14 1999/02/10 21:02:40 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -62,7 +62,7 @@ joininfo_member(List *join_relids, List *joininfo_list) ...@@ -62,7 +62,7 @@ joininfo_member(List *join_relids, List *joininfo_list)
* *
*/ */
JoinInfo * JoinInfo *
find_joininfo_node(RelOptInfo * this_rel, List *join_relids) find_joininfo_node(RelOptInfo *this_rel, List *join_relids)
{ {
JoinInfo *joininfo = joininfo_member(join_relids, JoinInfo *joininfo = joininfo_member(join_relids,
this_rel->joininfo); this_rel->joininfo);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/keys.c,v 1.13 1999/02/10 03:52:47 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/keys.c,v 1.14 1999/02/10 21:02:41 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -54,7 +54,7 @@ static bool equal_indexkey_var(int index_key, Var *var); ...@@ -54,7 +54,7 @@ static bool equal_indexkey_var(int index_key, Var *var);
* *
*/ */
bool bool
match_indexkey_operand(int indexkey, Var *operand, RelOptInfo * rel) match_indexkey_operand(int indexkey, Var *operand, RelOptInfo *rel)
{ {
if (IsA(operand, Var) && if (IsA(operand, Var) &&
(lfirsti(rel->relids) == operand->varno) && (lfirsti(rel->relids) == operand->varno) &&
...@@ -80,13 +80,13 @@ equal_indexkey_var(int index_key, Var *var) ...@@ -80,13 +80,13 @@ equal_indexkey_var(int index_key, Var *var)
} }
/* /*
* extract-subkey-- * extract-join-subkey--
* Returns the subkey in a join key corresponding to the outer or inner * Returns the subkey in a join key corresponding to the outer or inner
* lelation. * relation.
* *
*/ */
Var * Var *
extract_subkey(JoinKey *jk, int which_subkey) extract_join_subkey(JoinKey *jk, int which_subkey)
{ {
Var *retval; Var *retval;
...@@ -99,7 +99,7 @@ extract_subkey(JoinKey *jk, int which_subkey) ...@@ -99,7 +99,7 @@ extract_subkey(JoinKey *jk, int which_subkey)
retval = jk->inner; retval = jk->inner;
break; break;
default: /* do nothing */ default: /* do nothing */
elog(DEBUG, "extract_subkey with neither INNER or OUTER"); elog(DEBUG, "extract_join_subkey with neither INNER or OUTER");
retval = NULL; retval = NULL;
} }
return retval; return retval;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.22 1999/02/10 03:52:47 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.23 1999/02/10 21:02:43 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -220,7 +220,7 @@ better_path(Path *new_path, List *unique_paths, bool *noOther) ...@@ -220,7 +220,7 @@ better_path(Path *new_path, List *unique_paths, bool *noOther)
* *
*/ */
Path * Path *
create_seqscan_path(RelOptInfo * rel) create_seqscan_path(RelOptInfo *rel)
{ {
int relid = 0; int relid = 0;
...@@ -270,8 +270,8 @@ create_seqscan_path(RelOptInfo * rel) ...@@ -270,8 +270,8 @@ create_seqscan_path(RelOptInfo * rel)
*/ */
IndexPath * IndexPath *
create_index_path(Query *root, create_index_path(Query *root,
RelOptInfo * rel, RelOptInfo *rel,
RelOptInfo * index, RelOptInfo *index,
List *restriction_clauses, List *restriction_clauses,
bool is_join_scan) bool is_join_scan)
{ {
...@@ -419,8 +419,8 @@ create_index_path(Query *root, ...@@ -419,8 +419,8 @@ create_index_path(Query *root,
* *
*/ */
JoinPath * JoinPath *
create_nestloop_path(RelOptInfo * joinrel, create_nestloop_path(RelOptInfo *joinrel,
RelOptInfo * outer_rel, RelOptInfo *outer_rel,
Path *outer_path, Path *outer_path,
Path *inner_path, Path *inner_path,
List *pathkeys) List *pathkeys)
...@@ -487,7 +487,7 @@ create_nestloop_path(RelOptInfo * joinrel, ...@@ -487,7 +487,7 @@ create_nestloop_path(RelOptInfo * joinrel,
* *
*/ */
MergePath * MergePath *
create_mergejoin_path(RelOptInfo * joinrel, create_mergejoin_path(RelOptInfo *joinrel,
int outersize, int outersize,
int innersize, int innersize,
int outerwidth, int outerwidth,
...@@ -552,7 +552,7 @@ create_mergejoin_path(RelOptInfo * joinrel, ...@@ -552,7 +552,7 @@ create_mergejoin_path(RelOptInfo * joinrel,
* *
*/ */
HashPath * HashPath *
create_hashjoin_path(RelOptInfo * joinrel, create_hashjoin_path(RelOptInfo *joinrel,
int outersize, int outersize,
int innersize, int innersize,
int outerwidth, int outerwidth,
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.24 1999/02/07 03:02:21 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.25 1999/02/10 21:02:43 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -93,7 +93,7 @@ matching_tlvar(Var *var, List *targetlist) ...@@ -93,7 +93,7 @@ matching_tlvar(Var *var, List *targetlist)
* CREATES: new var-node iff no matching var-node exists in targetlist * CREATES: new var-node iff no matching var-node exists in targetlist
*/ */
void void
add_tl_element(RelOptInfo * rel, Var *var) add_tl_element(RelOptInfo *rel, Var *var)
{ {
Expr *oldvar = (Expr *) NULL; Expr *oldvar = (Expr *) NULL;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* $Id: cost.h,v 1.13 1999/02/10 03:52:53 momjian Exp $ * $Id: cost.h,v 1.14 1999/02/10 21:02:43 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -43,8 +43,8 @@ extern Cost cost_mergejoin(Cost outercost, Cost innercost, ...@@ -43,8 +43,8 @@ extern Cost cost_mergejoin(Cost outercost, Cost innercost,
extern Cost cost_hashjoin(Cost outercost, Cost innercost, List *outerkeys, extern Cost cost_hashjoin(Cost outercost, Cost innercost, List *outerkeys,
List *innerkeys, int outersize, int innersize, List *innerkeys, int outersize, int innersize,
int outerwidth, int innerwidth); int outerwidth, int innerwidth);
extern int compute_rel_size(RelOptInfo * rel); extern int compute_rel_size(RelOptInfo *rel);
extern int compute_rel_width(RelOptInfo * rel); extern int compute_rel_width(RelOptInfo *rel);
extern int compute_joinrel_size(JoinPath *joinpath); extern int compute_joinrel_size(JoinPath *joinpath);
extern int page_size(int tuples, int width); extern int page_size(int tuples, int width);
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* $Id: geqo.h,v 1.9 1998/09/01 04:36:56 momjian Exp $ * $Id: geqo.h,v 1.10 1999/02/10 21:02:45 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -76,7 +76,7 @@ extern void geqo_params(int string_length); ...@@ -76,7 +76,7 @@ extern void geqo_params(int string_length);
extern Cost geqo_eval(Query *root, Gene *tour, int num_gene); extern Cost geqo_eval(Query *root, Gene *tour, int num_gene);
double geqo_log(double x, double b); double geqo_log(double x, double b);
extern RelOptInfo *gimme_tree(Query *root, Gene *tour, int rel_count, int num_gene, RelOptInfo * outer_rel); extern RelOptInfo *gimme_tree(Query *root, Gene *tour, int rel_count, int num_gene, RelOptInfo *outer_rel);
#endif /* GEQO_H */ #endif /* GEQO_H */
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* $Id: geqo_misc.h,v 1.7 1998/09/01 04:36:59 momjian Exp $ * $Id: geqo_misc.h,v 1.8 1999/02/10 21:02:47 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -31,7 +31,7 @@ extern void print_pool(FILE *fp, Pool *pool, int start, int stop); ...@@ -31,7 +31,7 @@ extern void print_pool(FILE *fp, Pool *pool, int start, int stop);
extern void print_gen(FILE *fp, Pool *pool, int generation); extern void print_gen(FILE *fp, Pool *pool, int generation);
extern void print_edge_table(FILE *fp, Edge *edge_table, int num_gene); extern void print_edge_table(FILE *fp, Edge *edge_table, int num_gene);
extern void geqo_print_rel(Query *root, RelOptInfo * rel); extern void geqo_print_rel(Query *root, RelOptInfo *rel);
extern void geqo_print_path(Query *root, Path *path, int indent); extern void geqo_print_path(Query *root, Path *path, int indent);
extern void geqo_print_joinclauses(Query *root, List *clauses); extern void geqo_print_joinclauses(Query *root, List *clauses);
......
...@@ -5,7 +5,7 @@ ...@@ -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.h,v 1.6 1998/09/01 04:37:02 momjian Exp $ * $Id: geqo_paths.h,v 1.7 1999/02/10 21:02:47 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -23,6 +23,6 @@ ...@@ -23,6 +23,6 @@
extern List *geqo_prune_rels(List *rel_list); extern List *geqo_prune_rels(List *rel_list);
extern void geqo_rel_paths(RelOptInfo * rel); extern void geqo_rel_paths(RelOptInfo *rel);
#endif /* GEQO_PATHS_H */ #endif /* GEQO_PATHS_H */
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* $Id: joininfo.h,v 1.8 1998/09/01 04:37:10 momjian Exp $ * $Id: joininfo.h,v 1.9 1999/02/10 21:02:48 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include "nodes/primnodes.h" #include "nodes/primnodes.h"
extern JoinInfo *joininfo_member(List *join_relids, List *joininfo_list); extern JoinInfo *joininfo_member(List *join_relids, List *joininfo_list);
extern JoinInfo *find_joininfo_node(RelOptInfo * this_rel, List *join_relids); extern JoinInfo *find_joininfo_node(RelOptInfo *this_rel, List *join_relids);
extern Var *other_join_clause_var(Var *var, Expr *clause); extern Var *other_join_clause_var(Var *var, Expr *clause);
#endif /* JOININFO_H */ #endif /* JOININFO_H */
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* $Id: keys.h,v 1.8 1998/09/01 04:37:11 momjian Exp $ * $Id: keys.h,v 1.9 1999/02/10 21:02:48 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
#include "nodes/nodes.h" #include "nodes/nodes.h"
#include "nodes/relation.h" #include "nodes/relation.h"
extern bool match_indexkey_operand(int indexkey, Var *operand, RelOptInfo * rel); extern bool match_indexkey_operand(int indexkey, Var *operand, RelOptInfo *rel);
extern Var *extract_subkey(JoinKey *jk, int which_subkey); extern Var *extract_join_subkey(JoinKey *jk, int which_subkey);
extern bool samekeys(List *keys1, List *keys2); extern bool samekeys(List *keys1, List *keys2);
extern List *collect_index_pathkeys(int *index_keys, List *tlist); extern List *collect_index_pathkeys(int *index_keys, List *tlist);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* $Id: pathnode.h,v 1.11 1999/02/10 03:52:54 momjian Exp $ * $Id: pathnode.h,v 1.12 1999/02/10 21:02:49 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -21,20 +21,20 @@ ...@@ -21,20 +21,20 @@
* prototypes for pathnode.c * prototypes for pathnode.c
*/ */
extern bool path_is_cheaper(Path *path1, Path *path2); extern bool path_is_cheaper(Path *path1, Path *path2);
extern Path *set_cheapest(RelOptInfo * parent_rel, List *pathlist); extern Path *set_cheapest(RelOptInfo *parent_rel, List *pathlist);
extern List *add_pathlist(RelOptInfo * parent_rel, List *unique_paths, extern List *add_pathlist(RelOptInfo *parent_rel, List *unique_paths,
List *new_paths); List *new_paths);
extern Path *create_seqscan_path(RelOptInfo * rel); extern Path *create_seqscan_path(RelOptInfo *rel);
extern IndexPath *create_index_path(Query *root, RelOptInfo * rel, RelOptInfo * index, extern IndexPath *create_index_path(Query *root, RelOptInfo *rel, RelOptInfo *index,
List *restriction_clauses, bool is_join_scan); List *restriction_clauses, bool is_join_scan);
extern JoinPath *create_nestloop_path(RelOptInfo * joinrel, RelOptInfo * outer_rel, extern JoinPath *create_nestloop_path(RelOptInfo *joinrel, RelOptInfo *outer_rel,
Path *outer_path, Path *inner_path, List *pathkeys); Path *outer_path, Path *inner_path, List *pathkeys);
extern MergePath *create_mergejoin_path(RelOptInfo * joinrel, int outersize, extern MergePath *create_mergejoin_path(RelOptInfo *joinrel, int outersize,
int innersize, int outerwidth, int innerwidth, Path *outer_path, int innersize, int outerwidth, int innerwidth, Path *outer_path,
Path *inner_path, List *pathkeys, MergeOrder *order, Path *inner_path, List *pathkeys, MergeOrder *order,
List *mergeclauses, List *outersortkeys, List *innersortkeys); List *mergeclauses, List *outersortkeys, List *innersortkeys);
extern HashPath *create_hashjoin_path(RelOptInfo * joinrel, int outersize, extern HashPath *create_hashjoin_path(RelOptInfo *joinrel, int outersize,
int innersize, int outerwidth, int innerwidth, Path *outer_path, int innersize, int outerwidth, int innerwidth, Path *outer_path,
Path *inner_path, List *pathkeys, Oid operator, List *hashclauses, Path *inner_path, List *pathkeys, Oid operator, List *hashclauses,
List *outerkeys, List *innerkeys); List *outerkeys, List *innerkeys);
...@@ -49,6 +49,6 @@ extern RelOptInfo *get_join_rel(Query *root, List *relid); ...@@ -49,6 +49,6 @@ extern RelOptInfo *get_join_rel(Query *root, List *relid);
/* /*
* prototypes for indexnode.h * prototypes for indexnode.h
*/ */
extern List *find_relation_indices(Query *root, RelOptInfo * rel); extern List *find_relation_indices(Query *root, RelOptInfo *rel);
#endif /* PATHNODE_H */ #endif /* PATHNODE_H */
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* $Id: paths.h,v 1.12 1999/02/04 03:19:11 momjian Exp $ * $Id: paths.h,v 1.13 1999/02/10 21:02:49 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -27,7 +27,7 @@ extern List *find_paths(Query *root, List *rels); ...@@ -27,7 +27,7 @@ extern List *find_paths(Query *root, List *rels);
* indxpath.h * indxpath.h
* routines to generate index paths * routines to generate index paths
*/ */
extern List *find_index_paths(Query *root, RelOptInfo * rel, List *indices, extern List *find_index_paths(Query *root, RelOptInfo *rel, List *indices,
List *restrictinfo_list, List *restrictinfo_list,
List *joininfo_list); List *joininfo_list);
...@@ -41,7 +41,7 @@ extern void find_all_join_paths(Query *root, List *joinrels); ...@@ -41,7 +41,7 @@ extern void find_all_join_paths(Query *root, List *joinrels);
/* /*
* orindxpath.h * orindxpath.h
*/ */
extern List *create_or_index_paths(Query *root, RelOptInfo * rel, List *clauses); extern List *create_or_index_paths(Query *root, RelOptInfo *rel, List *clauses);
/* /*
* hashutils.h * hashutils.h
...@@ -86,7 +86,7 @@ extern List *final_join_rels(List *join_rel_list); ...@@ -86,7 +86,7 @@ extern List *final_join_rels(List *join_rel_list);
*/ */
extern void prune_joinrels(List *rel_list); extern void prune_joinrels(List *rel_list);
extern void prune_rel_paths(List *rel_list); extern void prune_rel_paths(List *rel_list);
extern Path *prune_rel_path(RelOptInfo * rel, Path *unorderedpath); extern Path *prune_rel_path(RelOptInfo *rel, Path *unorderedpath);
extern List *merge_joinrels(List *rel_list1, List *rel_list2); extern List *merge_joinrels(List *rel_list1, List *rel_list2);
extern List *prune_oldrels(List *old_rels); extern List *prune_oldrels(List *old_rels);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* $Id: tlist.h,v 1.13 1998/09/01 04:37:21 momjian Exp $ * $Id: tlist.h,v 1.14 1999/02/10 21:02:50 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extern TargetEntry *tlistentry_member(Var *var, List *targetlist); extern TargetEntry *tlistentry_member(Var *var, List *targetlist);
extern Expr *matching_tlvar(Var *var, List *targetlist); extern Expr *matching_tlvar(Var *var, List *targetlist);
extern void add_tl_element(RelOptInfo * rel, Var *var); extern void add_tl_element(RelOptInfo *rel, Var *var);
extern TargetEntry *create_tl_element(Var *var, int resdomno); extern TargetEntry *create_tl_element(Var *var, int resdomno);
extern List *get_actual_tlist(List *tlist); extern List *get_actual_tlist(List *tlist);
extern Resdom *tlist_member(Var *var, List *tlist); extern Resdom *tlist_member(Var *var, List *tlist);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* $Id: xfunc.h,v 1.11 1999/02/03 20:15:53 momjian Exp $ * $Id: xfunc.h,v 1.12 1999/02/10 21:02:50 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -49,7 +49,7 @@ extern int XfuncMode; /* defined in tcop/postgres.c */ ...@@ -49,7 +49,7 @@ extern int XfuncMode; /* defined in tcop/postgres.c */
#define is_join(pathnode) (length(get_relids(get_parent(pathnode))) > 1 ? 1 : 0) #define is_join(pathnode) (length(get_relids(get_parent(pathnode))) > 1 ? 1 : 0)
/* function prototypes from planner/path/xfunc.c */ /* function prototypes from planner/path/xfunc.c */
extern void xfunc_trypullup(RelOptInfo * rel); extern void xfunc_trypullup(RelOptInfo *rel);
extern int xfunc_shouldpull(Path *childpath, JoinPath *parentpath, extern int xfunc_shouldpull(Path *childpath, JoinPath *parentpath,
int whichchild, RestrictInfo * maxcinfopt); int whichchild, RestrictInfo * maxcinfopt);
extern RestrictInfo *xfunc_pullup(Path *childpath, JoinPath *parentpath, RestrictInfo * cinfo, extern RestrictInfo *xfunc_pullup(Path *childpath, JoinPath *parentpath, RestrictInfo * cinfo,
...@@ -69,7 +69,7 @@ extern List *xfunc_primary_join(JoinPath *pathnode); ...@@ -69,7 +69,7 @@ extern List *xfunc_primary_join(JoinPath *pathnode);
extern Cost xfunc_get_path_cost(Path *pathnode); extern Cost xfunc_get_path_cost(Path *pathnode);
extern Cost xfunc_total_path_cost(JoinPath *pathnode); extern Cost xfunc_total_path_cost(JoinPath *pathnode);
extern Cost xfunc_expense_per_tuple(JoinPath *joinnode, int whichchild); extern Cost xfunc_expense_per_tuple(JoinPath *joinnode, int whichchild);
extern void xfunc_fixvars(Expr *clause, RelOptInfo * rel, int varno); extern void xfunc_fixvars(Expr *clause, RelOptInfo *rel, int varno);
extern int xfunc_cinfo_compare(void *arg1, void *arg2); extern int xfunc_cinfo_compare(void *arg1, void *arg2);
extern int xfunc_clause_compare(void *arg1, void *arg2); extern int xfunc_clause_compare(void *arg1, void *arg2);
extern void xfunc_disjunct_sort(List *clause_list); extern void xfunc_disjunct_sort(List *clause_list);
...@@ -78,7 +78,7 @@ extern int xfunc_func_width(RegProcedure funcid, List *args); ...@@ -78,7 +78,7 @@ extern int xfunc_func_width(RegProcedure funcid, List *args);
extern int xfunc_tuple_width(Relation rd); extern int xfunc_tuple_width(Relation rd);
extern int xfunc_num_join_clauses(JoinPath *path); extern int xfunc_num_join_clauses(JoinPath *path);
extern List *xfunc_LispRemove(List *foo, List *bar); extern List *xfunc_LispRemove(List *foo, List *bar);
extern bool xfunc_copyrel(RelOptInfo * from, RelOptInfo ** to); extern bool xfunc_copyrel(RelOptInfo *from, RelOptInfo ** to);
/* /*
* function prototypes for path/predmig.c * function prototypes for path/predmig.c
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment