clauses.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*-------------------------------------------------------------------------
  2. *
  3. * clauses.h
  4. * prototypes for clauses.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/clauses.h
  11. *
  12. *-------------------------------------------------------------------------
  13. */
  14. #ifndef CLAUSES_H
  15. #define CLAUSES_H
  16. #include "nodes/pathnodes.h"
  17. typedef struct
  18. {
  19. int numWindowFuncs; /* total number of WindowFuncs found */
  20. Index maxWinRef; /* windowFuncs[] is indexed 0 .. maxWinRef */
  21. List **windowFuncs; /* lists of WindowFuncs for each winref */
  22. } WindowFuncLists;
  23. extern bool contain_agg_clause(Node *clause);
  24. extern bool contain_window_function(Node *clause);
  25. extern WindowFuncLists *find_window_functions(Node *clause, Index maxWinRef);
  26. extern double expression_returns_set_rows(PlannerInfo *root, Node *clause);
  27. extern bool contain_subplans(Node *clause);
  28. extern char max_parallel_hazard(Query *parse);
  29. extern bool is_parallel_safe(PlannerInfo *root, Node *node);
  30. extern bool contain_nonstrict_functions(Node *clause);
  31. extern bool contain_exec_param(Node *clause, List *param_ids);
  32. extern bool contain_leaked_vars(Node *clause);
  33. extern Relids find_nonnullable_rels(Node *clause);
  34. extern List *find_nonnullable_vars(Node *clause);
  35. extern List *find_forced_null_vars(Node *clause);
  36. extern Var *find_forced_null_var(Node *clause);
  37. extern bool is_pseudo_constant_clause(Node *clause);
  38. extern bool is_pseudo_constant_clause_relids(Node *clause, Relids relids);
  39. extern int NumRelids(PlannerInfo *root, Node *clause);
  40. extern void CommuteOpExpr(OpExpr *clause);
  41. extern Query *inline_set_returning_function(PlannerInfo *root,
  42. RangeTblEntry *rte);
  43. extern Bitmapset *pull_paramids(Expr *expr);
  44. #endif /* CLAUSES_H */