]> granicus.if.org Git - postgresql/blob - src/include/optimizer/pathnode.h
0bf57ef0cc5cb6bcfb828b6cd81dffadfd93bd82
[postgresql] / src / include / optimizer / pathnode.h
1 /*-------------------------------------------------------------------------
2  *
3  * pathnode.h
4  *        prototypes for pathnode.c, indexnode.c, relnode.c.
5  *
6  *
7  * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * $Id: pathnode.h,v 1.28 2000/09/12 21:07:11 tgl Exp $
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef PATHNODE_H
15 #define PATHNODE_H
16
17 #include "nodes/relation.h"
18
19 /*
20  * prototypes for pathnode.c
21  */
22 extern int compare_path_costs(Path *path1, Path *path2,
23                                    CostSelector criterion);
24 extern int compare_fractional_path_costs(Path *path1, Path *path2,
25                                                           double fraction);
26 extern void set_cheapest(RelOptInfo *parent_rel);
27 extern void add_path(RelOptInfo *parent_rel, Path *new_path);
28
29 extern Path *create_seqscan_path(RelOptInfo *rel);
30 extern IndexPath *create_index_path(Query *root, RelOptInfo *rel,
31                                   IndexOptInfo *index,
32                                   List *restriction_clauses,
33                                   ScanDirection indexscandir);
34 extern TidPath *create_tidscan_path(RelOptInfo *rel, List *tideval);
35
36 extern NestPath *create_nestloop_path(RelOptInfo *joinrel,
37                                                                           JoinType jointype,
38                                                                           Path *outer_path,
39                                                                           Path *inner_path,
40                                                                           List *restrict_clauses,
41                                                                           List *pathkeys);
42
43 extern MergePath *create_mergejoin_path(RelOptInfo *joinrel,
44                                                                                 JoinType jointype,
45                                                                                 Path *outer_path,
46                                                                                 Path *inner_path,
47                                                                                 List *restrict_clauses,
48                                                                                 List *pathkeys,
49                                                                                 List *mergeclauses,
50                                                                                 List *outersortkeys,
51                                                                                 List *innersortkeys);
52
53 extern HashPath *create_hashjoin_path(RelOptInfo *joinrel,
54                                                                           JoinType jointype,
55                                                                           Path *outer_path,
56                                                                           Path *inner_path,
57                                                                           List *restrict_clauses,
58                                                                           List *hashclauses,
59                                                                           Selectivity innerdisbursion);
60
61 /*
62  * prototypes for relnode.c
63  */
64 extern RelOptInfo *get_base_rel(Query *root, int relid);
65 extern RelOptInfo *get_join_rel(Query *root, RelOptInfo *outer_rel,
66                          RelOptInfo *inner_rel,
67                          List **restrictlist_ptr);
68
69 /*
70  * prototypes for indexnode.h
71  */
72 extern List *find_relation_indices(Query *root, RelOptInfo *rel);
73
74 #endif   /* PATHNODE_H */