1 | /*------------------------------------------------------------------------- |
2 | * |
3 | * planner.h |
4 | * prototypes for planner.c. |
5 | * |
6 | * Note that the primary entry points for planner.c are declared in |
7 | * optimizer/optimizer.h, because they're intended to be called from |
8 | * non-planner code. Declarations here are meant for use by other |
9 | * planner modules. |
10 | * |
11 | * Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group |
12 | * Portions Copyright (c) 1994, Regents of the University of California |
13 | * |
14 | * src/include/optimizer/planner.h |
15 | * |
16 | *------------------------------------------------------------------------- |
17 | */ |
18 | #ifndef PLANNER_H |
19 | #define PLANNER_H |
20 | |
21 | #include "nodes/pathnodes.h" |
22 | #include "nodes/plannodes.h" |
23 | |
24 | |
25 | /* Hook for plugins to get control in planner() */ |
26 | typedef PlannedStmt *(*planner_hook_type) (Query *parse, |
27 | int cursorOptions, |
28 | ParamListInfo boundParams); |
29 | extern PGDLLIMPORT planner_hook_type planner_hook; |
30 | |
31 | /* Hook for plugins to get control when grouping_planner() plans upper rels */ |
32 | typedef void (*create_upper_paths_hook_type) (PlannerInfo *root, |
33 | UpperRelationKind stage, |
34 | RelOptInfo *input_rel, |
35 | RelOptInfo *output_rel, |
36 | void *); |
37 | extern PGDLLIMPORT create_upper_paths_hook_type create_upper_paths_hook; |
38 | |
39 | |
40 | extern PlannedStmt *standard_planner(Query *parse, int cursorOptions, |
41 | ParamListInfo boundParams); |
42 | |
43 | extern PlannerInfo *subquery_planner(PlannerGlobal *glob, Query *parse, |
44 | PlannerInfo *parent_root, |
45 | bool hasRecursion, double tuple_fraction); |
46 | |
47 | extern RowMarkType select_rowmark_type(RangeTblEntry *rte, |
48 | LockClauseStrength strength); |
49 | |
50 | extern bool limit_needed(Query *parse); |
51 | |
52 | extern void mark_partial_aggref(Aggref *agg, AggSplit aggsplit); |
53 | |
54 | extern Path *get_cheapest_fractional_path(RelOptInfo *rel, |
55 | double tuple_fraction); |
56 | |
57 | extern Expr *preprocess_phv_expression(PlannerInfo *root, Expr *expr); |
58 | |
59 | #endif /* PLANNER_H */ |
60 | |