summaryrefslogtreecommitdiff
path: root/src/include/optimizer
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-04-01 00:48:33 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-04-01 00:48:33 +0000
commit6b73d7e5676298fe7891014adc56a0a32c807117 (patch)
tree698fa8db400ab8082d35826c9861fa6b711feb57 /src/include/optimizer
parentd344115519a5c88bfa8bf8551258f4eaaa1185be (diff)
downloadpostgresql-6b73d7e5676298fe7891014adc56a0a32c807117.tar.gz
Fix an oversight I made in a cleanup patch over a year ago:
eval_const_expressions needs to be passed the PlannerInfo ("root") structure, because in some cases we want it to substitute values for Param nodes. (So "constant" is not so constant as all that ...) This mistake partially disabled optimization of unnamed extended-Query statements in 8.3: in particular the LIKE-to-indexscan optimization would never be applied if the LIKE pattern was passed as a parameter, and constraint exclusion depending on a parameter value didn't work either.
Diffstat (limited to 'src/include/optimizer')
-rw-r--r--src/include/optimizer/clauses.h4
-rw-r--r--src/include/optimizer/plancat.h6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/include/optimizer/clauses.h b/src/include/optimizer/clauses.h
index b5d618595f..dce10d6506 100644
--- a/src/include/optimizer/clauses.h
+++ b/src/include/optimizer/clauses.h
@@ -7,7 +7,7 @@
* 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.89 2008/03/18 22:04:14 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/optimizer/clauses.h,v 1.90 2008/04/01 00:48:33 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -75,7 +75,7 @@ extern Node *strip_implicit_coercions(Node *node);
extern void set_coercionform_dontcare(Node *node);
-extern Node *eval_const_expressions(Node *node);
+extern Node *eval_const_expressions(PlannerInfo *root, Node *node);
extern Node *estimate_expression_value(PlannerInfo *root, Node *node);
diff --git a/src/include/optimizer/plancat.h b/src/include/optimizer/plancat.h
index 82b4c2200a..9e83549358 100644
--- a/src/include/optimizer/plancat.h
+++ b/src/include/optimizer/plancat.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/optimizer/plancat.h,v 1.48 2008/03/15 20:46:31 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/optimizer/plancat.h,v 1.49 2008/04/01 00:48:33 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -31,8 +31,8 @@ extern void get_relation_info(PlannerInfo *root, Oid relationObjectId,
extern void estimate_rel_size(Relation rel, int32 *attr_widths,
BlockNumber *pages, double *tuples);
-extern bool relation_excluded_by_constraints(RelOptInfo *rel,
- RangeTblEntry *rte);
+extern bool relation_excluded_by_constraints(PlannerInfo *root,
+ RelOptInfo *rel, RangeTblEntry *rte);
extern List *build_physical_tlist(PlannerInfo *root, RelOptInfo *rel);