aboutsummaryrefslogtreecommitdiff
path: root/src/backend/nodes
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-06-05 05:26:05 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-06-05 05:26:05 +0000
commit7c579fa12df0def35192e1e3cfc9ea7ab90bb0cb (patch)
tree70886176df00ac556e7992fde6e2ffd7c90530f9 /src/backend/nodes
parent28d2420eefdacfa928138d4b302fd6a31286225b (diff)
downloadpostgresql-7c579fa12df0def35192e1e3cfc9ea7ab90bb0cb.tar.gz
postgresql-7c579fa12df0def35192e1e3cfc9ea7ab90bb0cb.zip
Further work on making use of new statistics in planner. Adjust APIs
of costsize.c routines to pass Query root, so that costsize can figure more things out by itself and not be so dependent on its callers to tell it everything it needs to know. Use selectivity of hash or merge clause to estimate number of tuples processed internally in these joins (this is more useful than it would've been before, since eqjoinsel is somewhat more accurate than before).
Diffstat (limited to 'src/backend/nodes')
-rw-r--r--src/backend/nodes/copyfuncs.c5
-rw-r--r--src/backend/nodes/equalfuncs.c14
-rw-r--r--src/backend/nodes/readfuncs.c4
3 files changed, 13 insertions, 10 deletions
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c
index a5a968515e6..07907b63683 100644
--- a/src/backend/nodes/copyfuncs.c
+++ b/src/backend/nodes/copyfuncs.c
@@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.142 2001/05/20 20:28:17 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.143 2001/06/05 05:26:03 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1361,9 +1361,10 @@ _copyRestrictInfo(RestrictInfo *from)
* copy remainder of node
*/
Node_Copy(from, newnode, clause);
- newnode->eval_cost = from->eval_cost;
newnode->ispusheddown = from->ispusheddown;
Node_Copy(from, newnode, subclauseindices);
+ newnode->eval_cost = from->eval_cost;
+ newnode->this_selec = from->this_selec;
newnode->mergejoinoperator = from->mergejoinoperator;
newnode->left_sortop = from->left_sortop;
newnode->right_sortop = from->right_sortop;
diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c
index a89a8f7f335..656c1e9ea67 100644
--- a/src/backend/nodes/equalfuncs.c
+++ b/src/backend/nodes/equalfuncs.c
@@ -20,7 +20,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.90 2001/05/20 20:28:18 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.91 2001/06/05 05:26:03 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -514,14 +514,14 @@ _equalRestrictInfo(RestrictInfo *a, RestrictInfo *b)
{
if (!equal(a->clause, b->clause))
return false;
-
- /*
- * ignore eval_cost, left/right_pathkey, and left/right_bucketsize,
- * since they may not be set yet, and should be derivable from the
- * clause anyway
- */
if (a->ispusheddown != b->ispusheddown)
return false;
+ /*
+ * We ignore eval_cost, this_selec, left/right_pathkey, and
+ * left/right_bucketsize, since they may not be set yet, and should be
+ * derivable from the clause anyway. Probably it's not really necessary
+ * to compare any of these remaining fields ...
+ */
if (!equal(a->subclauseindices, b->subclauseindices))
return false;
if (a->mergejoinoperator != b->mergejoinoperator)
diff --git a/src/backend/nodes/readfuncs.c b/src/backend/nodes/readfuncs.c
index ad832d7ca9e..a83f0b64dbf 100644
--- a/src/backend/nodes/readfuncs.c
+++ b/src/backend/nodes/readfuncs.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.109 2001/05/20 20:28:18 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.110 2001/06/05 05:26:04 tgl Exp $
*
* NOTES
* Most of the read functions for plan nodes are tested. (In fact, they
@@ -1792,6 +1792,8 @@ _readRestrictInfo(void)
/* eval_cost is not part of saved representation; compute on first use */
local_node->eval_cost = -1;
+ /* ditto for this_selec */
+ local_node->this_selec = -1;
/* ditto for cached pathkeys and bucketsize */
local_node->left_pathkey = NIL;
local_node->right_pathkey = NIL;