planner.h 2.0 KB

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