restrictinfo.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*-------------------------------------------------------------------------
  2. *
  3. * restrictinfo.h
  4. * prototypes for restrictinfo.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/restrictinfo.h
  11. *
  12. *-------------------------------------------------------------------------
  13. */
  14. #ifndef RESTRICTINFO_H
  15. #define RESTRICTINFO_H
  16. #include "nodes/pathnodes.h"
  17. /* Convenience macro for the common case of a valid-everywhere qual */
  18. #define make_simple_restrictinfo(root, clause) \
  19. make_restrictinfo(root, clause, true, false, false, 0, NULL, NULL, NULL)
  20. extern RestrictInfo *make_restrictinfo(PlannerInfo *root,
  21. Expr *clause,
  22. bool is_pushed_down,
  23. bool outerjoin_delayed,
  24. bool pseudoconstant,
  25. Index security_level,
  26. Relids required_relids,
  27. Relids outer_relids,
  28. Relids nullable_relids);
  29. extern RestrictInfo *commute_restrictinfo(RestrictInfo *rinfo, Oid comm_op);
  30. extern bool restriction_is_or_clause(RestrictInfo *restrictinfo);
  31. extern bool restriction_is_securely_promotable(RestrictInfo *restrictinfo,
  32. RelOptInfo *rel);
  33. extern List *get_actual_clauses(List *restrictinfo_list);
  34. extern List *extract_actual_clauses(List *restrictinfo_list,
  35. bool pseudoconstant);
  36. extern void extract_actual_join_clauses(List *restrictinfo_list,
  37. Relids joinrelids,
  38. List **joinquals,
  39. List **otherquals);
  40. extern bool has_pseudoconstant_clauses(PlannerInfo *root,
  41. List *restrictinfo_list);
  42. extern bool join_clause_is_movable_to(RestrictInfo *rinfo, RelOptInfo *baserel);
  43. extern bool join_clause_is_movable_into(RestrictInfo *rinfo,
  44. Relids currentrelids,
  45. Relids current_and_outer);
  46. #endif /* RESTRICTINFO_H */