codekingpro/portable-devtools
115k
1/*-------------------------------------------------------------------------2 *3 * clauses.h4 * prototypes for clauses.c.5 *6 *7 * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group8 * Portions Copyright (c) 1994, Regents of the University of California9 *10 * src/include/optimizer/clauses.h11 *12 *-------------------------------------------------------------------------13 */14#ifndef CLAUSES_H15#define CLAUSES_H16 17#include "nodes/pathnodes.h"18 19typedef struct20{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 */24} WindowFuncLists;25 26extern bool contain_agg_clause(Node *clause);27 28extern bool contain_window_function(Node *clause);29extern WindowFuncLists *find_window_functions(Node *clause, Index maxWinRef);30 31extern double expression_returns_set_rows(PlannerInfo *root, Node *clause);32 33extern bool contain_subplans(Node *clause);34 35extern char max_parallel_hazard(Query *parse);36extern bool is_parallel_safe(PlannerInfo *root, Node *node);37extern bool contain_nonstrict_functions(Node *clause);38extern bool contain_exec_param(Node *clause, List *param_ids);39extern bool contain_leaked_vars(Node *clause);40 41extern Relids find_nonnullable_rels(Node *clause);42extern List *find_nonnullable_vars(Node *clause);43extern List *find_forced_null_vars(Node *node);44extern Var *find_forced_null_var(Node *node);45 46extern bool is_pseudo_constant_clause(Node *clause);47extern bool is_pseudo_constant_clause_relids(Node *clause, Relids relids);48 49extern int NumRelids(PlannerInfo *root, Node *clause);50 51extern void CommuteOpExpr(OpExpr *clause);52 53extern Query *inline_set_returning_function(PlannerInfo *root,54 RangeTblEntry *rte);55 56extern Bitmapset *pull_paramids(Expr *expr);57 58#endif /* CLAUSES_H */59 