planner.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. #include "nodes/plannodes.h"
  17. #include "nodes/relation.h"
  18. /* Hook for plugins to get control in planner() */
  19. typedef PlannedStmt *(*planner_hook_type) (Query *parse,
  20. int cursorOptions,
  21. ParamListInfo boundParams);
  22. extern PGDLLIMPORT planner_hook_type planner_hook;
  23. /* Hook for plugins to get control when grouping_planner() plans upper rels */
  24. typedef void (*create_upper_paths_hook_type) (PlannerInfo *root,
  25. UpperRelationKind stage,
  26. RelOptInfo *input_rel,
  27. RelOptInfo *output_rel);
  28. extern PGDLLIMPORT create_upper_paths_hook_type create_upper_paths_hook;
  29. extern PlannedStmt *planner(Query *parse, int cursorOptions,
  30. ParamListInfo boundParams);
  31. extern PlannedStmt *standard_planner(Query *parse, int cursorOptions,
  32. ParamListInfo boundParams);
  33. extern PlannerInfo *subquery_planner(PlannerGlobal *glob, Query *parse,
  34. PlannerInfo *parent_root,
  35. bool hasRecursion, double tuple_fraction);
  36. extern bool is_dummy_plan(Plan *plan);
  37. extern RowMarkType select_rowmark_type(RangeTblEntry *rte,
  38. LockClauseStrength strength);
  39. extern void mark_partial_aggref(Aggref *agg, AggSplit aggsplit);
  40. extern Path *get_cheapest_fractional_path(RelOptInfo *rel,
  41. double tuple_fraction);
  42. extern Expr *expression_planner(Expr *expr);
  43. extern Expr *preprocess_phv_expression(PlannerInfo *root, Expr *expr);
  44. extern bool plan_cluster_use_sort(Oid tableOid, Oid indexOid);
  45. #endif /* PLANNER_H */