~ubuntu-branches/ubuntu/oneiric/postgresql-9.1/oneiric-security

« back to all changes in this revision

Viewing changes to src/include/optimizer/clauses.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-05-11 10:41:53 UTC
  • Revision ID: james.westby@ubuntu.com-20110511104153-psbh2o58553fv1m0
Tags: upstream-9.1~beta1
ImportĀ upstreamĀ versionĀ 9.1~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*-------------------------------------------------------------------------
 
2
 *
 
3
 * clauses.h
 
4
 *        prototypes for clauses.c.
 
5
 *
 
6
 *
 
7
 * Portions Copyright (c) 1996-2011, 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/relation.h"
 
18
 
 
19
 
 
20
#define is_opclause(clause)             ((clause) != NULL && IsA(clause, OpExpr))
 
21
#define is_funcclause(clause)   ((clause) != NULL && IsA(clause, FuncExpr))
 
22
 
 
23
typedef struct
 
24
{
 
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 */
 
28
} WindowFuncLists;
 
29
 
 
30
 
 
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);
 
36
 
 
37
extern bool not_clause(Node *clause);
 
38
extern Expr *make_notclause(Expr *notclause);
 
39
extern Expr *get_notclausearg(Expr *notclause);
 
40
 
 
41
extern bool or_clause(Node *clause);
 
42
extern Expr *make_orclause(List *orclauses);
 
43
 
 
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);
 
49
 
 
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);
 
54
 
 
55
extern bool contain_window_function(Node *clause);
 
56
extern WindowFuncLists *find_window_functions(Node *clause, Index maxWinRef);
 
57
 
 
58
extern double expression_returns_set_rows(Node *clause);
 
59
 
 
60
extern bool contain_subplans(Node *clause);
 
61
 
 
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);
 
69
 
 
70
extern bool is_pseudo_constant_clause(Node *clause);
 
71
extern bool is_pseudo_constant_clause_relids(Node *clause, Relids relids);
 
72
 
 
73
extern int      NumRelids(Node *clause);
 
74
 
 
75
extern void CommuteOpExpr(OpExpr *clause);
 
76
extern void CommuteRowCompareExpr(RowCompareExpr *clause);
 
77
 
 
78
extern Node *strip_implicit_coercions(Node *node);
 
79
 
 
80
extern void set_coercionform_dontcare(Node *node);
 
81
 
 
82
extern Node *eval_const_expressions(PlannerInfo *root, Node *node);
 
83
 
 
84
extern Node *estimate_expression_value(PlannerInfo *root, Node *node);
 
85
 
 
86
extern Query *inline_set_returning_function(PlannerInfo *root,
 
87
                                                          RangeTblEntry *rte);
 
88
 
 
89
#endif   /* CLAUSES_H */