1
/*-------------------------------------------------------------------------
4
* prototypes for clauses.c.
7
* Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
8
* Portions Copyright (c) 1994, Regents of the University of California
10
* src/include/optimizer/clauses.h
12
*-------------------------------------------------------------------------
17
#include "nodes/relation.h"
20
#define is_opclause(clause) ((clause) != NULL && IsA(clause, OpExpr))
21
#define is_funcclause(clause) ((clause) != NULL && IsA(clause, FuncExpr))
25
int numWindowFuncs; /* total number of WindowFuncs found */
26
Index maxWinRef; /* windowFuncs[] is indexed 0 .. maxWinRef */
27
List **windowFuncs; /* lists of WindowFuncs for each winref */
31
extern Expr *make_opclause(Oid opno, Oid opresulttype, bool opretset,
32
Expr *leftop, Expr *rightop,
33
Oid opcollid, Oid inputcollid);
34
extern Node *get_leftop(Expr *clause);
35
extern Node *get_rightop(Expr *clause);
37
extern bool not_clause(Node *clause);
38
extern Expr *make_notclause(Expr *notclause);
39
extern Expr *get_notclausearg(Expr *notclause);
41
extern bool or_clause(Node *clause);
42
extern Expr *make_orclause(List *orclauses);
44
extern bool and_clause(Node *clause);
45
extern Expr *make_andclause(List *andclauses);
46
extern Node *make_and_qual(Node *qual1, Node *qual2);
47
extern Expr *make_ands_explicit(List *andclauses);
48
extern List *make_ands_implicit(Expr *clause);
50
extern bool contain_agg_clause(Node *clause);
51
extern List *pull_agg_clause(Node *clause);
52
extern void count_agg_clauses(PlannerInfo *root, Node *clause,
53
AggClauseCosts *costs);
55
extern bool contain_window_function(Node *clause);
56
extern WindowFuncLists *find_window_functions(Node *clause, Index maxWinRef);
58
extern double expression_returns_set_rows(Node *clause);
60
extern bool contain_subplans(Node *clause);
62
extern bool contain_mutable_functions(Node *clause);
63
extern bool contain_volatile_functions(Node *clause);
64
extern bool contain_nonstrict_functions(Node *clause);
65
extern Relids find_nonnullable_rels(Node *clause);
66
extern List *find_nonnullable_vars(Node *clause);
67
extern List *find_forced_null_vars(Node *clause);
68
extern Var *find_forced_null_var(Node *clause);
70
extern bool is_pseudo_constant_clause(Node *clause);
71
extern bool is_pseudo_constant_clause_relids(Node *clause, Relids relids);
73
extern int NumRelids(Node *clause);
75
extern void CommuteOpExpr(OpExpr *clause);
76
extern void CommuteRowCompareExpr(RowCompareExpr *clause);
78
extern Node *strip_implicit_coercions(Node *node);
80
extern void set_coercionform_dontcare(Node *node);
82
extern Node *eval_const_expressions(PlannerInfo *root, Node *node);
84
extern Node *estimate_expression_value(PlannerInfo *root, Node *node);
86
extern Query *inline_set_returning_function(PlannerInfo *root,
89
#endif /* CLAUSES_H */