aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeHash.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-01-09 00:26:47 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-01-09 00:26:47 +0000
commit166b5c1def56a8c43536ac64bd0ba92517f67765 (patch)
tree09a047af2ae3b27e0c071a2fd1fbd32785a66190 /src/backend/executor/nodeHash.c
parent69d4299e3e534686274480ba245566914932c017 (diff)
downloadpostgresql-166b5c1def56a8c43536ac64bd0ba92517f67765.tar.gz
postgresql-166b5c1def56a8c43536ac64bd0ba92517f67765.zip
Another round of planner/optimizer work. This is just restructuring and
code cleanup; no major improvements yet. However, EXPLAIN does produce more intuitive outputs for nested loops with indexscans now...
Diffstat (limited to 'src/backend/executor/nodeHash.c')
-rw-r--r--src/backend/executor/nodeHash.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/backend/executor/nodeHash.c b/src/backend/executor/nodeHash.c
index 3d5083a7ba9..1995048e2db 100644
--- a/src/backend/executor/nodeHash.c
+++ b/src/backend/executor/nodeHash.c
@@ -6,7 +6,7 @@
* Copyright (c) 1994, Regents of the University of California
*
*
- * $Id: nodeHash.c,v 1.41 1999/12/16 22:19:44 wieck Exp $
+ * $Id: nodeHash.c,v 1.42 2000/01/09 00:26:18 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -227,7 +227,7 @@ HashJoinTable
ExecHashTableCreate(Hash *node)
{
Plan *outerNode;
- int ntuples;
+ double ntuples;
int tupsize;
double inner_rel_bytes;
double hash_table_bytes;
@@ -250,9 +250,9 @@ ExecHashTableCreate(Hash *node)
* ----------------
*/
outerNode = outerPlan(node);
- ntuples = outerNode->plan_size;
- if (ntuples <= 0) /* force a plausible size if no info */
- ntuples = 1000;
+ ntuples = outerNode->plan_rows;
+ if (ntuples <= 0.0) /* force a plausible size if no info */
+ ntuples = 1000.0;
/*
* estimate tupsize based on footprint of tuple in hashtable... but
@@ -260,7 +260,7 @@ ExecHashTableCreate(Hash *node)
*/
tupsize = MAXALIGN(outerNode->plan_width) +
MAXALIGN(sizeof(HashJoinTupleData));
- inner_rel_bytes = (double) ntuples *tupsize * FUDGE_FAC;
+ inner_rel_bytes = ntuples * tupsize * FUDGE_FAC;
/*
* Target hashtable size is SortMem kilobytes, but not less than
@@ -276,7 +276,7 @@ ExecHashTableCreate(Hash *node)
* for an average bucket load of NTUP_PER_BUCKET (per virtual
* bucket!).
*/
- totalbuckets = (int) ceil((double) ntuples * FUDGE_FAC / NTUP_PER_BUCKET);
+ totalbuckets = (int) ceil(ntuples * FUDGE_FAC / NTUP_PER_BUCKET);
/*
* Count the number of buckets we think will actually fit in the