Header And Logo

PostgreSQL
| The world's most advanced open source database.

pathnode.h

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  * pathnode.h
00004  *    prototypes for pathnode.c, relnode.c.
00005  *
00006  *
00007  * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
00008  * Portions Copyright (c) 1994, Regents of the University of California
00009  *
00010  * src/include/optimizer/pathnode.h
00011  *
00012  *-------------------------------------------------------------------------
00013  */
00014 #ifndef PATHNODE_H
00015 #define PATHNODE_H
00016 
00017 #include "nodes/relation.h"
00018 
00019 
00020 /*
00021  * prototypes for pathnode.c
00022  */
00023 extern int compare_path_costs(Path *path1, Path *path2,
00024                    CostSelector criterion);
00025 extern int compare_fractional_path_costs(Path *path1, Path *path2,
00026                               double fraction);
00027 extern void set_cheapest(RelOptInfo *parent_rel);
00028 extern void add_path(RelOptInfo *parent_rel, Path *new_path);
00029 extern bool add_path_precheck(RelOptInfo *parent_rel,
00030                   Cost startup_cost, Cost total_cost,
00031                   List *pathkeys, Relids required_outer);
00032 
00033 extern Path *create_seqscan_path(PlannerInfo *root, RelOptInfo *rel,
00034                     Relids required_outer);
00035 extern IndexPath *create_index_path(PlannerInfo *root,
00036                   IndexOptInfo *index,
00037                   List *indexclauses,
00038                   List *indexclausecols,
00039                   List *indexorderbys,
00040                   List *indexorderbycols,
00041                   List *pathkeys,
00042                   ScanDirection indexscandir,
00043                   bool indexonly,
00044                   Relids required_outer,
00045                   double loop_count);
00046 extern BitmapHeapPath *create_bitmap_heap_path(PlannerInfo *root,
00047                         RelOptInfo *rel,
00048                         Path *bitmapqual,
00049                         Relids required_outer,
00050                         double loop_count);
00051 extern BitmapAndPath *create_bitmap_and_path(PlannerInfo *root,
00052                        RelOptInfo *rel,
00053                        List *bitmapquals);
00054 extern BitmapOrPath *create_bitmap_or_path(PlannerInfo *root,
00055                       RelOptInfo *rel,
00056                       List *bitmapquals);
00057 extern TidPath *create_tidscan_path(PlannerInfo *root, RelOptInfo *rel,
00058                     List *tidquals, Relids required_outer);
00059 extern AppendPath *create_append_path(RelOptInfo *rel, List *subpaths,
00060                    Relids required_outer);
00061 extern MergeAppendPath *create_merge_append_path(PlannerInfo *root,
00062                          RelOptInfo *rel,
00063                          List *subpaths,
00064                          List *pathkeys,
00065                          Relids required_outer);
00066 extern ResultPath *create_result_path(List *quals);
00067 extern MaterialPath *create_material_path(RelOptInfo *rel, Path *subpath);
00068 extern UniquePath *create_unique_path(PlannerInfo *root, RelOptInfo *rel,
00069                    Path *subpath, SpecialJoinInfo *sjinfo);
00070 extern Path *create_subqueryscan_path(PlannerInfo *root, RelOptInfo *rel,
00071                          List *pathkeys, Relids required_outer);
00072 extern Path *create_functionscan_path(PlannerInfo *root, RelOptInfo *rel,
00073                          Relids required_outer);
00074 extern Path *create_valuesscan_path(PlannerInfo *root, RelOptInfo *rel,
00075                        Relids required_outer);
00076 extern Path *create_ctescan_path(PlannerInfo *root, RelOptInfo *rel,
00077                     Relids required_outer);
00078 extern Path *create_worktablescan_path(PlannerInfo *root, RelOptInfo *rel,
00079                           Relids required_outer);
00080 extern ForeignPath *create_foreignscan_path(PlannerInfo *root, RelOptInfo *rel,
00081                         double rows, Cost startup_cost, Cost total_cost,
00082                         List *pathkeys,
00083                         Relids required_outer,
00084                         List *fdw_private);
00085 
00086 extern Relids calc_nestloop_required_outer(Path *outer_path, Path *inner_path);
00087 extern Relids calc_non_nestloop_required_outer(Path *outer_path, Path *inner_path);
00088 
00089 extern NestPath *create_nestloop_path(PlannerInfo *root,
00090                      RelOptInfo *joinrel,
00091                      JoinType jointype,
00092                      JoinCostWorkspace *workspace,
00093                      SpecialJoinInfo *sjinfo,
00094                      SemiAntiJoinFactors *semifactors,
00095                      Path *outer_path,
00096                      Path *inner_path,
00097                      List *restrict_clauses,
00098                      List *pathkeys,
00099                      Relids required_outer);
00100 
00101 extern MergePath *create_mergejoin_path(PlannerInfo *root,
00102                       RelOptInfo *joinrel,
00103                       JoinType jointype,
00104                       JoinCostWorkspace *workspace,
00105                       SpecialJoinInfo *sjinfo,
00106                       Path *outer_path,
00107                       Path *inner_path,
00108                       List *restrict_clauses,
00109                       List *pathkeys,
00110                       Relids required_outer,
00111                       List *mergeclauses,
00112                       List *outersortkeys,
00113                       List *innersortkeys);
00114 
00115 extern HashPath *create_hashjoin_path(PlannerInfo *root,
00116                      RelOptInfo *joinrel,
00117                      JoinType jointype,
00118                      JoinCostWorkspace *workspace,
00119                      SpecialJoinInfo *sjinfo,
00120                      SemiAntiJoinFactors *semifactors,
00121                      Path *outer_path,
00122                      Path *inner_path,
00123                      List *restrict_clauses,
00124                      Relids required_outer,
00125                      List *hashclauses);
00126 
00127 extern Path *reparameterize_path(PlannerInfo *root, Path *path,
00128                     Relids required_outer,
00129                     double loop_count);
00130 
00131 /*
00132  * prototypes for relnode.c
00133  */
00134 extern void setup_simple_rel_arrays(PlannerInfo *root);
00135 extern RelOptInfo *build_simple_rel(PlannerInfo *root, int relid,
00136                  RelOptKind reloptkind);
00137 extern RelOptInfo *find_base_rel(PlannerInfo *root, int relid);
00138 extern RelOptInfo *find_join_rel(PlannerInfo *root, Relids relids);
00139 extern RelOptInfo *build_join_rel(PlannerInfo *root,
00140                Relids joinrelids,
00141                RelOptInfo *outer_rel,
00142                RelOptInfo *inner_rel,
00143                SpecialJoinInfo *sjinfo,
00144                List **restrictlist_ptr);
00145 extern AppendRelInfo *find_childrel_appendrelinfo(PlannerInfo *root,
00146                             RelOptInfo *rel);
00147 extern ParamPathInfo *get_baserel_parampathinfo(PlannerInfo *root,
00148                           RelOptInfo *baserel,
00149                           Relids required_outer);
00150 extern ParamPathInfo *get_joinrel_parampathinfo(PlannerInfo *root,
00151                           RelOptInfo *joinrel,
00152                           Path *outer_path,
00153                           Path *inner_path,
00154                           SpecialJoinInfo *sjinfo,
00155                           Relids required_outer,
00156                           List **restrict_clauses);
00157 extern ParamPathInfo *get_appendrel_parampathinfo(RelOptInfo *appendrel,
00158                             Relids required_outer);
00159 
00160 #endif   /* PATHNODE_H */