PostgreSQL Source Code git master
Loading...
Searching...
No Matches
planner.h
Go to the documentation of this file.
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-2026, 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
25typedef struct ExplainState ExplainState; /* defined in explain_state.h */
26
27/* Hook for plugins to get control in planner() */
28typedef PlannedStmt *(*planner_hook_type) (Query *parse,
29 const char *query_string,
30 int cursorOptions,
31 ParamListInfo boundParams,
32 ExplainState *es);
34
35/* Hook for plugins to get control after PlannerGlobal is initialized */
37 const char *query_string,
38 int cursorOptions,
39 double *tuple_fraction,
40 ExplainState *es);
42
43/* Hook for plugins to get control before PlannerGlobal is discarded */
45 const char *query_string,
48
49/* Hook for plugins to get control when grouping_planner() plans upper rels */
54 void *extra);
56
57
58extern PlannedStmt *standard_planner(Query *parse, const char *query_string,
59 int cursorOptions,
60 ParamListInfo boundParams,
61 ExplainState *es);
62
64 char *plan_name,
66 bool hasRecursion, double tuple_fraction,
68
70 LockClauseStrength strength);
71
72extern bool limit_needed(Query *parse);
73
74extern void mark_partial_aggref(Aggref *agg, AggSplit aggsplit);
75
77 double tuple_fraction);
78
80
82 SpecialJoinInfo *sjinfo);
83
84extern char *choose_plan_name(PlannerGlobal *glob, const char *name,
85 bool always_number);
86
87#endif /* PLANNER_H */
#define PGDLLIMPORT
Definition c.h:1356
void parse(int)
Definition parse.c:49
LockClauseStrength
Definition lockoptions.h:22
AggSplit
Definition nodes.h:385
UpperRelationKind
Definition pathnodes.h:143
PGDLLIMPORT planner_shutdown_hook_type planner_shutdown_hook
Definition planner.c:80
char * choose_plan_name(PlannerGlobal *glob, const char *name, bool always_number)
Definition planner.c:9024
RelOptInfo * create_unique_paths(PlannerInfo *root, RelOptInfo *rel, SpecialJoinInfo *sjinfo)
Definition planner.c:8472
PlannerInfo * subquery_planner(PlannerGlobal *glob, Query *parse, char *plan_name, PlannerInfo *parent_root, bool hasRecursion, double tuple_fraction, SetOperationStmt *setops)
Definition planner.c:743
Path * get_cheapest_fractional_path(RelOptInfo *rel, double tuple_fraction)
Definition planner.c:6657
Expr * preprocess_phv_expression(PlannerInfo *root, Expr *expr)
Definition planner.c:1481
RowMarkType select_rowmark_type(RangeTblEntry *rte, LockClauseStrength strength)
Definition planner.c:2590
void mark_partial_aggref(Aggref *agg, AggSplit aggsplit)
Definition planner.c:5818
PGDLLIMPORT planner_setup_hook_type planner_setup_hook
Definition planner.c:77
PlannedStmt * standard_planner(Query *parse, const char *query_string, int cursorOptions, ParamListInfo boundParams, ExplainState *es)
Definition planner.c:333
bool limit_needed(Query *parse)
Definition planner.c:2841
PlannedStmt *(* planner_hook_type)(Query *parse, const char *query_string, int cursorOptions, ParamListInfo boundParams, ExplainState *es)
Definition planner.h:28
PGDLLIMPORT create_upper_paths_hook_type create_upper_paths_hook
Definition planner.c:83
void(* planner_setup_hook_type)(PlannerGlobal *glob, Query *parse, const char *query_string, int cursorOptions, double *tuple_fraction, ExplainState *es)
Definition planner.h:36
PGDLLIMPORT planner_hook_type planner_hook
Definition planner.c:74
void(* create_upper_paths_hook_type)(PlannerInfo *root, UpperRelationKind stage, RelOptInfo *input_rel, RelOptInfo *output_rel, void *extra)
Definition planner.h:50
void(* planner_shutdown_hook_type)(PlannerGlobal *glob, Query *parse, const char *query_string, PlannedStmt *pstmt)
Definition planner.h:44
RowMarkType
Definition plannodes.h:1554
static int fb(int x)
tree ctl root
Definition radixtree.h:1857
PlannedStmt * pstmt
const char * name