plancat.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*-------------------------------------------------------------------------
  2. *
  3. * plancat.h
  4. * prototypes for plancat.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/plancat.h
  11. *
  12. *-------------------------------------------------------------------------
  13. */
  14. #ifndef PLANCAT_H
  15. #define PLANCAT_H
  16. #include "nodes/relation.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_relation_data_width(Oid relid, int32 *attr_widths);
  30. extern bool relation_excluded_by_constraints(PlannerInfo *root,
  31. RelOptInfo *rel, RangeTblEntry *rte);
  32. extern List *build_physical_tlist(PlannerInfo *root, RelOptInfo *rel);
  33. extern bool has_unique_index(RelOptInfo *rel, AttrNumber attno);
  34. extern Selectivity restriction_selectivity(PlannerInfo *root,
  35. Oid operatorid,
  36. List *args,
  37. Oid inputcollid,
  38. int varRelid);
  39. extern Selectivity join_selectivity(PlannerInfo *root,
  40. Oid operatorid,
  41. List *args,
  42. Oid inputcollid,
  43. JoinType jointype,
  44. SpecialJoinInfo *sjinfo);
  45. extern bool has_row_triggers(PlannerInfo *root, Index rti, CmdType event);
  46. #endif /* PLANCAT_H */