From 166b5c1def56a8c43536ac64bd0ba92517f67765 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 9 Jan 2000 00:26:47 +0000 Subject: 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... --- src/backend/executor/nodeHash.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/backend/executor/nodeHash.c') 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 -- cgit v1.2.3