PostgreSQL Source Code  git master
clauses.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * clauses.h
4  * prototypes for clauses.c.
5  *
6  *
7  * Portions Copyright (c) 1996-2021, 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 
17 #include "nodes/pathnodes.h"
18 
19 typedef struct
20 {
21  int numWindowFuncs; /* total number of WindowFuncs found */
22  Index maxWinRef; /* windowFuncs[] is indexed 0 .. maxWinRef */
23  List **windowFuncs; /* lists of WindowFuncs for each winref */
25 
26 extern bool contain_agg_clause(Node *clause);
27 
28 extern bool contain_window_function(Node *clause);
29 extern WindowFuncLists *find_window_functions(Node *clause, Index maxWinRef);
30 
31 extern double expression_returns_set_rows(PlannerInfo *root, Node *clause);
32 
33 extern bool contain_subplans(Node *clause);
34 
35 extern char max_parallel_hazard(Query *parse);
36 extern bool is_parallel_safe(PlannerInfo *root, Node *node);
37 extern bool contain_nonstrict_functions(Node *clause);
38 extern bool contain_exec_param(Node *clause, List *param_ids);
39 extern bool contain_leaked_vars(Node *clause);
40 
41 extern Relids find_nonnullable_rels(Node *clause);
42 extern List *find_nonnullable_vars(Node *clause);
43 extern List *find_forced_null_vars(Node *clause);
44 extern Var *find_forced_null_var(Node *clause);
45 
46 extern bool is_pseudo_constant_clause(Node *clause);
47 extern bool is_pseudo_constant_clause_relids(Node *clause, Relids relids);
48 
49 extern int NumRelids(PlannerInfo *root, Node *clause);
50 
51 extern void CommuteOpExpr(OpExpr *clause);
52 
54  RangeTblEntry *rte);
55 
56 #endif /* CLAUSES_H */
bool contain_agg_clause(Node *clause)
Definition: clauses.c:171
char max_parallel_hazard(Query *parse)
Definition: clauses.c:616
bool is_pseudo_constant_clause_relids(Node *clause, Relids relids)
Definition: clauses.c:1946
Index maxWinRef
Definition: clauses.h:22
int NumRelids(PlannerInfo *root, Node *clause)
Definition: clauses.c:1968
Query * inline_set_returning_function(PlannerInfo *root, RangeTblEntry *rte)
Definition: clauses.c:4772
int numWindowFuncs
Definition: clauses.h:21
Definition: nodes.h:539
double expression_returns_set_rows(PlannerInfo *root, Node *clause)
Definition: clauses.c:283
bool contain_leaked_vars(Node *clause)
Definition: clauses.c:1145
void CommuteOpExpr(OpExpr *clause)
Definition: clauses.c:1983
Definition: primnodes.h:186
bool contain_exec_param(Node *clause, List *param_ids)
Definition: clauses.c:1019
Relids find_nonnullable_rels(Node *clause)
Definition: clauses.c:1338
bool contain_window_function(Node *clause)
Definition: clauses.c:208
unsigned int Index
Definition: c.h:549
Var * find_forced_null_var(Node *clause)
Definition: clauses.c:1815
bool is_pseudo_constant_clause(Node *clause)
Definition: clauses.c:1926
bool contain_subplans(Node *clause)
Definition: clauses.c:324
WindowFuncLists * find_window_functions(Node *clause, Index maxWinRef)
Definition: clauses.c:221
List * find_forced_null_vars(Node *clause)
Definition: clauses.c:1756
bool contain_nonstrict_functions(Node *clause)
Definition: clauses.c:875
List * find_nonnullable_vars(Node *clause)
Definition: clauses.c:1563
Definition: pg_list.h:50
List ** windowFuncs
Definition: clauses.h:23
bool is_parallel_safe(PlannerInfo *root, Node *node)
Definition: clauses.c:635
static struct subre * parse(struct vars *, int, int, struct state *, struct state *)
Definition: regcomp.c:665