* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/optimizer/clauses.h,v 1.95 2008/10/09 19:27:40 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/optimizer/clauses.h,v 1.96 2008/12/28 18:54:01 tgl Exp $
*
*-------------------------------------------------------------------------
*/
Size transitionSpace; /* for pass-by-ref transition data */
} AggClauseCounts;
+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;
+
extern Expr *make_opclause(Oid opno, Oid opresulttype, bool opretset,
Expr *leftop, Expr *rightop);
extern List *make_ands_implicit(Expr *clause);
extern bool contain_agg_clause(Node *clause);
+extern List *pull_agg_clause(Node *clause);
extern void count_agg_clauses(Node *clause, AggClauseCounts *counts);
+extern bool contain_window_function(Node *clause);
+extern WindowFuncLists *find_window_functions(Node *clause, Index maxWinRef);
+
extern double expression_returns_set_rows(Node *clause);
extern bool contain_subplans(Node *clause);