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