summaryrefslogtreecommitdiff
path: root/src/include/nodes
diff options
context:
space:
mode:
authorTom Lane2000-12-12 23:33:34 +0000
committerTom Lane2000-12-12 23:33:34 +0000
commit17b843d67718a716c1abb4afd2abf8a5edba9f32 (patch)
treea6ed16c25800f101e8c3d2b246460dc45a3ae5dd /src/include/nodes
parent77c443f8cd24ed439538db699de04c44474d9f33 (diff)
Cache eval cost of qualification expressions in RestrictInfo nodes to
avoid repeated evaluations in cost_qual_eval(). This turns out to save a useful fraction of planning time. No change to external representation of RestrictInfo --- although that node type doesn't appear in stored rules anyway.
Diffstat (limited to 'src/include/nodes')
-rw-r--r--src/include/nodes/relation.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/include/nodes/relation.h b/src/include/nodes/relation.h
index 45d53be5f62..366392df0de 100644
--- a/src/include/nodes/relation.h
+++ b/src/include/nodes/relation.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: relation.h,v 1.50 2000/11/12 00:37:01 tgl Exp $
+ * $Id: relation.h,v 1.51 2000/12/12 23:33:32 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -373,9 +373,9 @@ typedef JoinPath NestPath;
* A mergejoin path has these fields.
*
* path_mergeclauses lists the clauses (in the form of RestrictInfos)
- * that will be used in the merge. (Before 7.0, this was a list of
- * bare clause expressions, but we can save on list memory by leaving
- * it in the form of a RestrictInfo list.)
+ * that will be used in the merge. (Before 7.0, this was a list of bare
+ * clause expressions, but we can save on list memory and cost_qual_eval
+ * work by leaving it in the form of a RestrictInfo list.)
*
* Note that the mergeclauses are a subset of the parent relation's
* restriction-clause list. Any join clauses that are not mergejoinable
@@ -491,6 +491,8 @@ typedef struct RestrictInfo
Expr *clause; /* the represented clause of WHERE or JOIN */
+ Cost eval_cost; /* eval cost of clause; -1 if not yet set */
+
bool ispusheddown; /* TRUE if clause was pushed down in level */
/* only used if clause is an OR clause: */