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-2020, 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 "access/htup.h"
18 #include "nodes/pathnodes.h"
19 
20 typedef struct
21 {
22  int numWindowFuncs; /* total number of WindowFuncs found */
23  Index maxWinRef; /* windowFuncs[] is indexed 0 .. maxWinRef */
24  List **windowFuncs; /* lists of WindowFuncs for each winref */
26 
27 extern bool contain_agg_clause(Node *clause);
28 extern void get_agg_clause_costs(PlannerInfo *root, Node *clause,
29  AggSplit aggsplit, AggClauseCosts *costs);
30 
31 extern bool contain_window_function(Node *clause);
32 extern WindowFuncLists *find_window_functions(Node *clause, Index maxWinRef);
33 
34 extern double expression_returns_set_rows(PlannerInfo *root, Node *clause);
35 
36 extern bool contain_subplans(Node *clause);
37 
38 extern char max_parallel_hazard(Query *parse);
39 extern bool is_parallel_safe(PlannerInfo *root, Node *node);
40 extern bool contain_nonstrict_functions(Node *clause);
41 extern bool contain_exec_param(Node *clause, List *param_ids);
42 extern bool contain_leaked_vars(Node *clause);
43 
44 extern Relids find_nonnullable_rels(Node *clause);
45 extern List *find_nonnullable_vars(Node *clause);
46 extern List *find_forced_null_vars(Node *clause);
47 extern Var *find_forced_null_var(Node *clause);
48 
49 extern bool is_pseudo_constant_clause(Node *clause);
50 extern bool is_pseudo_constant_clause_relids(Node *clause, Relids relids);
51 
52 extern int NumRelids(Node *clause);
53 
54 extern void CommuteOpExpr(OpExpr *clause);
55 
57  RangeTblEntry *rte);
58 
59 #endif /* CLAUSES_H */
bool contain_agg_clause(Node *clause)
Definition: clauses.c:179
char max_parallel_hazard(Query *parse)
Definition: clauses.c:835
bool is_pseudo_constant_clause_relids(Node *clause, Relids relids)
Definition: clauses.c:2143
Index maxWinRef
Definition: clauses.h:23
Query * inline_set_returning_function(PlannerInfo *root, RangeTblEntry *rte)
Definition: clauses.c:4849
int numWindowFuncs
Definition: clauses.h:22
Definition: nodes.h:528
double expression_returns_set_rows(PlannerInfo *root, Node *clause)
Definition: clauses.c:569
bool contain_leaked_vars(Node *clause)
Definition: clauses.c:1361
void CommuteOpExpr(OpExpr *clause)
Definition: clauses.c:2180
Definition: primnodes.h:181
bool contain_exec_param(Node *clause, List *param_ids)
Definition: clauses.c:1235
void get_agg_clause_costs(PlannerInfo *root, Node *clause, AggSplit aggsplit, AggClauseCosts *costs)
Definition: clauses.c:229
Relids find_nonnullable_rels(Node *clause)
Definition: clauses.c:1535
bool contain_window_function(Node *clause)
Definition: clauses.c:494
int NumRelids(Node *clause)
Definition: clauses.c:2165
unsigned int Index
Definition: c.h:483
Var * find_forced_null_var(Node *clause)
Definition: clauses.c:2012
bool is_pseudo_constant_clause(Node *clause)
Definition: clauses.c:2123
AggSplit
Definition: nodes.h:779
bool contain_subplans(Node *clause)
Definition: clauses.c:610
WindowFuncLists * find_window_functions(Node *clause, Index maxWinRef)
Definition: clauses.c:507
List * find_forced_null_vars(Node *clause)
Definition: clauses.c:1953
bool contain_nonstrict_functions(Node *clause)
Definition: clauses.c:1094
List * find_nonnullable_vars(Node *clause)
Definition: clauses.c:1760
Definition: pg_list.h:50
List ** windowFuncs
Definition: clauses.h:24
bool is_parallel_safe(PlannerInfo *root, Node *node)
Definition: clauses.c:854
static struct subre * parse(struct vars *, int, int, struct state *, struct state *)
Definition: regcomp.c:648