]> granicus.if.org Git - postgresql/blob - src/include/optimizer/paths.h
Fix optimizer and make faster.
[postgresql] / src / include / optimizer / paths.h
1 /*-------------------------------------------------------------------------
2  *
3  * paths.h--
4  *        prototypes for various files in optimizer/paths (were separate
5  *        header files
6  *
7  *
8  * Copyright (c) 1994, Regents of the University of California
9  *
10  * $Id: paths.h,v 1.14 1999/02/12 05:57:08 momjian Exp $
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef PATHS_H
15 #define PATHS_H
16
17 #include "nodes/nodes.h"
18 #include "nodes/parsenodes.h"
19 #include "nodes/relation.h"
20
21 /*
22  * allpaths.h
23  */
24 extern List *find_paths(Query *root, List *rels);
25
26 /*
27  * indxpath.h
28  *        routines to generate index paths
29  */
30 extern List *find_index_paths(Query *root, RelOptInfo *rel, List *indices,
31                                  List *restrictinfo_list,
32                                  List *joininfo_list);
33
34 /*
35  * joinpath.h
36  *         routines to create join paths
37  */
38 extern void find_all_join_paths(Query *root, List *joinrels);
39
40
41 /*
42  * orindxpath.h
43  */
44 extern List *create_or_index_paths(Query *root, RelOptInfo *rel, List *clauses);
45
46 /*
47  * hashutils.h
48  *        routines to deal with hash keys and clauses
49  */
50 extern List *group_clauses_by_hashop(List *restrictinfo_list,
51                                                 int inner_relid);
52
53 /*
54  * joinutils.h
55  *        generic join method key/clause routines
56  */
57 extern List *match_pathkeys_joinkeys(List *pathkeys,
58                                          List *joinkeys, List *joinclauses, int which_subkey,
59                                                 List **matchedJoinClausesPtr);
60 extern List *extract_path_keys(List *joinkeys, List *tlist,
61                                   int which_subkey);
62 extern Path *match_paths_joinkeys(List *joinkeys, PathOrder *ordering,
63                                          List *paths, int which_subkey);
64 extern List *new_join_pathkeys(List *outer_pathkeys,
65                                   List *join_rel_tlist, List *joinclauses);
66
67 /*
68  * mergeutils.h
69  *        routines to deal with merge keys and clauses
70  */
71 extern List *group_clauses_by_order(List *restrictinfo_list,
72                                            int inner_relid);
73 extern MergeInfo *match_order_mergeinfo(PathOrder *ordering,
74                                           List *mergeinfo_list);
75
76 /*
77  * joinrels.h
78  *        routines to determine which relations to join
79  */
80 extern List *find_join_rels(Query *root, List *outer_rels);
81 extern void add_new_joininfos(Query *root, List *joinrels, List *outerrels);
82 extern List *final_join_rels(List *join_rel_list);
83
84 /*
85  * prototypes for path/prune.c
86  */
87 extern void prune_joinrels(List *rel_list);
88 extern void rels_set_cheapest(List *rel_list);
89 extern List *merge_joinrels(List *rel_list1, List *rel_list2);
90 extern List *prune_oldrels(List *old_rels);
91
92 #endif   /* PATHS_H */