1 /*-------------------------------------------------------------------------
2  *
3  * planner.h
4  *	  prototypes for planner.c.
5  *
6  *
7  * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/optimizer/planner.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef PLANNER_H
15 #define PLANNER_H
16 
17 #include "nodes/plannodes.h"
18 #include "nodes/relation.h"
19 
20 
21 /* Hook for plugins to get control in planner() */
22 typedef PlannedStmt *(*planner_hook_type) (Query *parse,
23 													   int cursorOptions,
24 												  ParamListInfo boundParams);
25 extern PGDLLIMPORT planner_hook_type planner_hook;
26 
27 /* Hook for plugins to get control when grouping_planner() plans upper rels */
28 typedef void (*create_upper_paths_hook_type) (PlannerInfo *root,
29 													 UpperRelationKind stage,
30 													   RelOptInfo *input_rel,
31 													 RelOptInfo *output_rel);
32 extern PGDLLIMPORT create_upper_paths_hook_type create_upper_paths_hook;
33 
34 
35 extern PlannedStmt *planner(Query *parse, int cursorOptions,
36 		ParamListInfo boundParams);
37 extern PlannedStmt *standard_planner(Query *parse, int cursorOptions,
38 				 ParamListInfo boundParams);
39 
40 extern PlannerInfo *subquery_planner(PlannerGlobal *glob, Query *parse,
41 				 PlannerInfo *parent_root,
42 				 bool hasRecursion, double tuple_fraction);
43 
44 extern bool is_dummy_plan(Plan *plan);
45 
46 extern RowMarkType select_rowmark_type(RangeTblEntry *rte,
47 					LockClauseStrength strength);
48 
49 extern bool limit_needed(Query *parse);
50 
51 extern void mark_partial_aggref(Aggref *agg, AggSplit aggsplit);
52 
53 extern Path *get_cheapest_fractional_path(RelOptInfo *rel,
54 							 double tuple_fraction);
55 
56 extern Expr *expression_planner(Expr *expr);
57 
58 extern Expr *preprocess_phv_expression(PlannerInfo *root, Expr *expr);
59 
60 extern bool plan_cluster_use_sort(Oid tableOid, Oid indexOid);
61 
62 #endif   /* PLANNER_H */
63