Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
2 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*-------------------------------------------------------------------------
 *
 * clauses.h
 *    prototypes for clauses.c.
 *
 *
 * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
 * Portions Copyright (c) 1994, Regents of the University of California
 *
 * src/include/optimizer/clauses.h
 *
 *-------------------------------------------------------------------------
 */
#ifndef CLAUSES_H
#define CLAUSES_H
 
#include "nodes/pathnodes.h"
 
typedef struct
{
    int         numWindowFuncs; /* total number of WindowFuncs found */
    Index       maxWinRef;      /* windowFuncs[] is indexed 0 .. maxWinRef */
    List      **windowFuncs;    /* lists of WindowFuncs for each winref */
} WindowFuncLists;
 
/*
 * Callback used by expression_has_grouping_conflict below.  Given a Var, the
 * callback returns the equality operator that the relevant grouping mechanism
 * (GROUP BY, DISTINCT, DISTINCT ON, window PARTITION BY, or set operation)
 * uses for the column the Var references, or InvalidOid if the Var does not
 * participate in that grouping.  Returning InvalidOid signals "not a grouping
 * column" to both the opfamily and collation checks.
 */
typedef Oid (*grouping_eqop_callback) (Var *var, void *context);
 
extern bool contain_agg_clause(Node *clause);
 
extern bool contain_window_function(Node *clause);
extern WindowFuncLists *find_window_functions(Node *clause, Index maxWinRef);
 
extern double expression_returns_set_rows(PlannerInfo *root, Node *clause);
 
extern bool contain_subplans(Node *clause);
 
extern char max_parallel_hazard(Query *parse);
extern bool is_parallel_safe(PlannerInfo *root, Node *node);
extern bool contain_nonstrict_functions(Node *clause);
extern bool contain_exec_param(Node *clause, List *param_ids);
extern bool contain_leaked_vars(Node *clause);
 
extern Relids find_nonnullable_rels(Node *clause);
extern List *find_nonnullable_vars(Node *clause);
extern List *find_forced_null_vars(Node *node);
extern Var *find_forced_null_var(Node *node);
extern bool query_outputs_are_not_nullable(Query *query);
 
extern bool is_pseudo_constant_clause(Node *clause);
extern bool is_pseudo_constant_clause_relids(Node *clause, Relids relids);
 
extern int  NumRelids(PlannerInfo *root, Node *clause);
 
extern void CommuteOpExpr(OpExpr *clause);
 
extern Query *inline_function_in_from(PlannerInfo *root,
                                      RangeTblEntry *rte);
 
extern Bitmapset *pull_paramids(Expr *expr);
 
extern bool expression_has_grouping_conflict(Node *expr,
                                             grouping_eqop_callback get_eqop,
                                             void *context);
 
#endif                          /* CLAUSES_H */