diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-01-22 01:35:23 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-01-22 01:35:23 +0000 |
| commit | 5a7471c307533a1b56260b3b074dfdd20e1be5ae (patch) | |
| tree | 6a3cff705e779eefac734882a66aee1631224394 /src/include/optimizer | |
| parent | a85e9c61e579b15d0635e04870cf1cb069fdf9ee (diff) | |
| download | postgresql-5a7471c307533a1b56260b3b074dfdd20e1be5ae.tar.gz | |
Add COST and ROWS options to CREATE/ALTER FUNCTION, plus underlying pg_proc
columns procost and prorows, to allow simple user adjustment of the estimated
cost of a function call, as well as control of the estimated number of rows
returned by a set-returning function. We might eventually wish to extend this
to allow function-specific estimation routines, but there seems to be
consensus that we should try a simple constant estimate first. In particular
this provides a relatively simple way to control the order in which different
WHERE clauses are applied in a plan node, which is a Good Thing in view of the
fact that the recent EquivalenceClass planner rewrite made that much less
predictable than before.
Diffstat (limited to 'src/include/optimizer')
| -rw-r--r-- | src/include/optimizer/clauses.h | 3 | ||||
| -rw-r--r-- | src/include/optimizer/cost.h | 3 | ||||
| -rw-r--r-- | src/include/optimizer/planmain.h | 3 |
3 files changed, 6 insertions, 3 deletions
diff --git a/src/include/optimizer/clauses.h b/src/include/optimizer/clauses.h index a115baabae..5001125914 100644 --- a/src/include/optimizer/clauses.h +++ b/src/include/optimizer/clauses.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/optimizer/clauses.h,v 1.85 2007/01/05 22:19:56 momjian Exp $ + * $PostgreSQL: pgsql/src/include/optimizer/clauses.h,v 1.86 2007/01/22 01:35:22 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -51,6 +51,7 @@ extern bool contain_agg_clause(Node *clause); extern void count_agg_clauses(Node *clause, AggClauseCounts *counts); extern bool expression_returns_set(Node *clause); +extern double expression_returns_set_rows(Node *clause); extern bool contain_subplans(Node *clause); diff --git a/src/include/optimizer/cost.h b/src/include/optimizer/cost.h index 9ecfe7ebc8..fde65ed874 100644 --- a/src/include/optimizer/cost.h +++ b/src/include/optimizer/cost.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/optimizer/cost.h,v 1.83 2007/01/05 22:19:56 momjian Exp $ + * $PostgreSQL: pgsql/src/include/optimizer/cost.h,v 1.84 2007/01/22 01:35:22 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -89,6 +89,7 @@ extern void cost_nestloop(NestPath *path, PlannerInfo *root); extern void cost_mergejoin(MergePath *path, PlannerInfo *root); extern void cost_hashjoin(HashPath *path, PlannerInfo *root); extern void cost_qual_eval(QualCost *cost, List *quals); +extern void cost_qual_eval_node(QualCost *cost, Node *qual); extern void set_baserel_size_estimates(PlannerInfo *root, RelOptInfo *rel); extern void set_joinrel_size_estimates(PlannerInfo *root, RelOptInfo *rel, RelOptInfo *outer_rel, diff --git a/src/include/optimizer/planmain.h b/src/include/optimizer/planmain.h index 5118061182..6bf34e162a 100644 --- a/src/include/optimizer/planmain.h +++ b/src/include/optimizer/planmain.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/optimizer/planmain.h,v 1.98 2007/01/20 20:45:40 tgl Exp $ + * $PostgreSQL: pgsql/src/include/optimizer/planmain.h,v 1.99 2007/01/22 01:35:22 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -97,5 +97,6 @@ extern List *set_returning_clause_references(List *rlist, Index resultRelation); extern void fix_opfuncids(Node *node); extern void set_opfuncid(OpExpr *opexpr); +extern void set_sa_opfuncid(ScalarArrayOpExpr *opexpr); #endif /* PLANMAIN_H */ |
