2
0

plancat.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*-------------------------------------------------------------------------
  2. *
  3. * plancat.h
  4. * prototypes for plancat.c.
  5. *
  6. *
  7. * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
  8. * Portions Copyright (c) 1994, Regents of the University of California
  9. *
  10. * src/include/optimizer/plancat.h
  11. *
  12. *-------------------------------------------------------------------------
  13. */
  14. #ifndef PLANCAT_H
  15. #define PLANCAT_H
  16. #include "nodes/pathnodes.h"
  17. #include "utils/relcache.h"
  18. /* Hook for plugins to get control in get_relation_info() */
  19. typedef void (*get_relation_info_hook_type) (PlannerInfo *root,
  20. Oid relationObjectId,
  21. bool inhparent,
  22. RelOptInfo *rel);
  23. extern PGDLLIMPORT get_relation_info_hook_type get_relation_info_hook;
  24. extern void get_relation_info(PlannerInfo *root, Oid relationObjectId,
  25. bool inhparent, RelOptInfo *rel);
  26. extern List *infer_arbiter_indexes(PlannerInfo *root);
  27. extern void estimate_rel_size(Relation rel, int32 *attr_widths,
  28. BlockNumber *pages, double *tuples, double *allvisfrac);
  29. extern int32 get_rel_data_width(Relation rel, int32 *attr_widths);
  30. extern int32 get_relation_data_width(Oid relid, int32 *attr_widths);
  31. extern bool relation_excluded_by_constraints(PlannerInfo *root,
  32. RelOptInfo *rel, RangeTblEntry *rte);
  33. extern List *build_physical_tlist(PlannerInfo *root, RelOptInfo *rel);
  34. extern bool has_unique_index(RelOptInfo *rel, AttrNumber attno);
  35. extern Selectivity restriction_selectivity(PlannerInfo *root,
  36. Oid operatorid,
  37. List *args,
  38. Oid inputcollid,
  39. int varRelid);
  40. extern Selectivity join_selectivity(PlannerInfo *root,
  41. Oid operatorid,
  42. List *args,
  43. Oid inputcollid,
  44. JoinType jointype,
  45. SpecialJoinInfo *sjinfo);
  46. extern Selectivity function_selectivity(PlannerInfo *root,
  47. Oid funcid,
  48. List *args,
  49. Oid inputcollid,
  50. bool is_join,
  51. int varRelid,
  52. JoinType jointype,
  53. SpecialJoinInfo *sjinfo);
  54. extern void add_function_cost(PlannerInfo *root, Oid funcid, Node *node,
  55. QualCost *cost);
  56. extern double get_function_rows(PlannerInfo *root, Oid funcid, Node *node);
  57. extern bool has_row_triggers(PlannerInfo *root, Index rti, CmdType event);
  58. extern bool has_stored_generated_columns(PlannerInfo *root, Index rti);
  59. extern Bitmapset *get_dependent_generated_columns(PlannerInfo *root, Index rti,
  60. Bitmapset *target_cols);
  61. #endif /* PLANCAT_H */