diff options
Diffstat (limited to 'src/include/optimizer')
| -rw-r--r-- | src/include/optimizer/clauses.h | 3 | ||||
| -rw-r--r-- | src/include/optimizer/joininfo.h | 3 | ||||
| -rw-r--r-- | src/include/optimizer/keys.h | 23 | ||||
| -rw-r--r-- | src/include/optimizer/ordering.h | 25 | ||||
| -rw-r--r-- | src/include/optimizer/pathnode.h | 28 | ||||
| -rw-r--r-- | src/include/optimizer/paths.h | 49 | ||||
| -rw-r--r-- | src/include/optimizer/tlist.h | 5 |
7 files changed, 43 insertions, 93 deletions
diff --git a/src/include/optimizer/clauses.h b/src/include/optimizer/clauses.h index 381da4adaeb..ec2dce883fc 100644 --- a/src/include/optimizer/clauses.h +++ b/src/include/optimizer/clauses.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: clauses.h,v 1.27 1999/08/12 04:32:49 tgl Exp $ + * $Id: clauses.h,v 1.28 1999/08/16 02:17:44 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -40,7 +40,6 @@ extern List *make_ands_implicit(Expr *clause); extern List *pull_constant_clauses(List *quals, List **constantQual); extern void clause_get_relids_vars(Node *clause, Relids *relids, List **vars); extern int NumRelids(Node *clause); -extern bool is_joinable(Node *clause); extern List *fix_opids(List *clauses); extern void get_relattval(Node *clause, int targetrelid, int *relid, AttrNumber *attno, diff --git a/src/include/optimizer/joininfo.h b/src/include/optimizer/joininfo.h index ac723261849..4c1aedfba3f 100644 --- a/src/include/optimizer/joininfo.h +++ b/src/include/optimizer/joininfo.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: joininfo.h,v 1.13 1999/07/15 15:21:22 momjian Exp $ + * $Id: joininfo.h,v 1.14 1999/08/16 02:17:44 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -17,6 +17,5 @@ extern JoinInfo *joininfo_member(List *join_relids, List *joininfo_list); extern JoinInfo *find_joininfo_node(RelOptInfo *this_rel, List *join_relids); -extern Var *other_join_clause_var(Var *var, Expr *clause); #endif /* JOININFO_H */ diff --git a/src/include/optimizer/keys.h b/src/include/optimizer/keys.h deleted file mode 100644 index 67910c283fd..00000000000 --- a/src/include/optimizer/keys.h +++ /dev/null @@ -1,23 +0,0 @@ -/*------------------------------------------------------------------------- - * - * keys.h - * prototypes for keys.c. - * - * - * Copyright (c) 1994, Regents of the University of California - * - * $Id: keys.h,v 1.16 1999/07/15 15:21:22 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef KEYS_H -#define KEYS_H - -#include "nodes/relation.h" - -extern bool match_indexkey_operand(int indexkey, Var *operand, RelOptInfo *rel); -extern Var *extract_join_key(JoinKey *jk, int outer_or_inner); -extern bool pathkeys_match(List *keys1, List *keys2, int *better_key); -extern List *collect_index_pathkeys(int *index_keys, List *tlist); - -#endif /* KEYS_H */ diff --git a/src/include/optimizer/ordering.h b/src/include/optimizer/ordering.h deleted file mode 100644 index 61dc0a43366..00000000000 --- a/src/include/optimizer/ordering.h +++ /dev/null @@ -1,25 +0,0 @@ -/*------------------------------------------------------------------------- - * - * ordering.h - * prototypes for ordering.c. - * - * - * Copyright (c) 1994, Regents of the University of California - * - * $Id: ordering.h,v 1.15 1999/07/15 23:03:58 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef ORDERING_H -#define ORDERING_H - -#include "nodes/relation.h" - -extern bool pathorder_match(PathOrder *path_ordering1, - PathOrder *path_ordering2, int *better_sort); -extern bool equal_path_merge_ordering(Oid *path_ordering, - MergeOrder *merge_ordering); -extern bool equal_merge_ordering(MergeOrder *merge_ordering1, - MergeOrder *merge_ordering2); - -#endif /* ORDERING_H */ diff --git a/src/include/optimizer/pathnode.h b/src/include/optimizer/pathnode.h index aa5be0661e3..65ece63c575 100644 --- a/src/include/optimizer/pathnode.h +++ b/src/include/optimizer/pathnode.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: pathnode.h,v 1.20 1999/08/06 04:00:13 tgl Exp $ + * $Id: pathnode.h,v 1.21 1999/08/16 02:17:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -20,22 +20,26 @@ */ extern bool path_is_cheaper(Path *path1, Path *path2); extern Path *set_cheapest(RelOptInfo *parent_rel, List *pathlist); -extern List *add_pathlist(RelOptInfo *parent_rel, List *unique_paths, - List *new_paths); +extern List *add_pathlist(RelOptInfo *parent_rel, List *old_paths, + List *new_paths); + extern Path *create_seqscan_path(RelOptInfo *rel); -extern IndexPath *create_index_path(Query *root, RelOptInfo *rel, RelOptInfo *index, - List *restriction_clauses); -extern NestPath *create_nestloop_path(RelOptInfo *joinrel, RelOptInfo *outer_rel, - Path *outer_path, Path *inner_path, List *pathkeys); + +extern IndexPath *create_index_path(Query *root, RelOptInfo *rel, + RelOptInfo *index, List *restriction_clauses); + +extern NestPath *create_nestloop_path(RelOptInfo *joinrel, + RelOptInfo *outer_rel, Path *outer_path, Path *inner_path, + List *pathkeys); + extern MergePath *create_mergejoin_path(RelOptInfo *joinrel, int outersize, - int innersize, int outerwidth, int innerwidth, Path *outer_path, - Path *inner_path, List *pathkeys, MergeOrder *order, - List *mergeclauses, List *outersortkeys, List *innersortkeys); + int innersize, int outerwidth, int innerwidth, Path *outer_path, + Path *inner_path, List *pathkeys, + List *mergeclauses, List *outersortkeys, List *innersortkeys); extern HashPath *create_hashjoin_path(RelOptInfo *joinrel, int outersize, int innersize, int outerwidth, int innerwidth, Path *outer_path, - Path *inner_path, List *pathkeys, Oid operator, List *hashclauses, - List *outerkeys, List *innerkeys, Cost innerdisbursion); + Path *inner_path, List *hashclauses, Cost innerdisbursion); /* * prototypes for rel.c diff --git a/src/include/optimizer/paths.h b/src/include/optimizer/paths.h index f074f1eee1f..b0ec64c3e32 100644 --- a/src/include/optimizer/paths.h +++ b/src/include/optimizer/paths.h @@ -7,7 +7,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: paths.h,v 1.33 1999/07/27 06:23:11 tgl Exp $ + * $Id: paths.h,v 1.34 1999/08/16 02:17:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -43,35 +43,28 @@ extern void update_rels_pathlist_for_joins(Query *root, List *joinrels); extern List *create_or_index_paths(Query *root, RelOptInfo *rel, List *clauses); /* - * hashutils.c - * routines to deal with hash keys and clauses + * pathkeys.c + * utilities for matching and building path keys */ -extern List *group_clauses_by_hashop(List *restrictinfo_list, - Relids inner_relids); +typedef enum +{ + PATHKEYS_EQUAL, /* pathkeys are identical */ + PATHKEYS_BETTER1, /* pathkey 1 is a superset of pathkey 2 */ + PATHKEYS_BETTER2, /* vice versa */ + PATHKEYS_DIFFERENT /* neither pathkey includes the other */ +} PathKeysComparison; -/* - * joinutils.c - * generic join method key/clause routines - */ -extern bool order_joinkeys_by_pathkeys(List *pathkeys, - List *joinkeys, List *joinclauses, int outer_or_inner, - List **matchedJoinKeysPtr, - List **matchedJoinClausesPtr); -extern List *make_pathkeys_from_joinkeys(List *joinkeys, List *tlist, - int outer_or_inner); -extern Path *get_cheapest_path_for_joinkeys(List *joinkeys, - PathOrder *ordering, List *paths, int outer_or_inner); -extern List *new_join_pathkeys(List *outer_pathkeys, - List *join_rel_tlist, List *joinclauses); - -/* - * mergeutils.c - * routines to deal with merge keys and clauses - */ -extern List *group_clauses_by_order(List *restrictinfo_list, - Relids inner_relids); -extern MergeInfo *match_order_mergeinfo(PathOrder *ordering, - List *mergeinfo_list); +extern PathKeysComparison compare_pathkeys(List *keys1, List *keys2); +extern bool pathkeys_contained_in(List *keys1, List *keys2); +extern Path *get_cheapest_path_for_pathkeys(List *paths, List *pathkeys); +extern List *build_index_pathkeys(Query *root, RelOptInfo *rel, + RelOptInfo *index); +extern List *build_join_pathkeys(List *outer_pathkeys, + List *join_rel_tlist, List *joinclauses); +extern List *find_mergeclauses_for_pathkeys(List *pathkeys, + List *restrictinfos); +extern List *make_pathkeys_for_mergeclauses(List *mergeclauses, + List *tlist); /* * joinrels.c diff --git a/src/include/optimizer/tlist.h b/src/include/optimizer/tlist.h index 860b077de21..fb08b708352 100644 --- a/src/include/optimizer/tlist.h +++ b/src/include/optimizer/tlist.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: tlist.h,v 1.19 1999/07/15 15:21:23 momjian Exp $ + * $Id: tlist.h,v 1.20 1999/08/16 02:17:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -30,4 +30,7 @@ extern List *flatten_tlist(List *tlist); extern List *flatten_tlist_vars(List *full_tlist, List *flat_tlist); +extern Var *get_expr(TargetEntry *tle); +extern Var *get_groupclause_expr(GroupClause *groupClause, List *targetList); + #endif /* TLIST_H */ |
