]> granicus.if.org Git - postgresql/blob - src/include/optimizer/pathnode.h
Take OUTER JOIN semantics into account when estimating the size of join
[postgresql] / src / include / optimizer / pathnode.h
1 /*-------------------------------------------------------------------------
2  *
3  * pathnode.h
4  *        prototypes for pathnode.c, relnode.c.
5  *
6  *
7  * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * $Id: pathnode.h,v 1.34 2001/02/16 00:03:06 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                                   List *pathkeys,
34                                   ScanDirection indexscandir);
35 extern TidPath *create_tidscan_path(RelOptInfo *rel, List *tideval);
36 extern AppendPath *create_append_path(RelOptInfo *rel, List *subpaths);
37 extern Path *create_subqueryscan_path(RelOptInfo *rel);
38
39 extern NestPath *create_nestloop_path(RelOptInfo *joinrel,
40                                                                           JoinType jointype,
41                                                                           Path *outer_path,
42                                                                           Path *inner_path,
43                                                                           List *restrict_clauses,
44                                                                           List *pathkeys);
45
46 extern MergePath *create_mergejoin_path(RelOptInfo *joinrel,
47                                                                                 JoinType jointype,
48                                                                                 Path *outer_path,
49                                                                                 Path *inner_path,
50                                                                                 List *restrict_clauses,
51                                                                                 List *pathkeys,
52                                                                                 List *mergeclauses,
53                                                                                 List *outersortkeys,
54                                                                                 List *innersortkeys);
55
56 extern HashPath *create_hashjoin_path(RelOptInfo *joinrel,
57                                                                           JoinType jointype,
58                                                                           Path *outer_path,
59                                                                           Path *inner_path,
60                                                                           List *restrict_clauses,
61                                                                           List *hashclauses,
62                                                                           Selectivity innerdispersion);
63
64 /*
65  * prototypes for relnode.c
66  */
67 extern RelOptInfo *get_base_rel(Query *root, int relid);
68 extern RelOptInfo *make_base_rel(Query *root, int relid);
69 extern RelOptInfo *get_join_rel(Query *root,
70                                                                 RelOptInfo *outer_rel,
71                                                                 RelOptInfo *inner_rel,
72                                                                 JoinType jointype,
73                                                                 List **restrictlist_ptr);
74
75 #endif   /* PATHNODE_H */