summaryrefslogtreecommitdiff
path: root/src/include/optimizer/pathnode.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>1999-08-06 04:00:17 +0000
committerTom Lane <tgl@sss.pgh.pa.us>1999-08-06 04:00:17 +0000
commite1fad50a5d362d78b9f571b71b372faaa597462a (patch)
treefb7953f8d6bb903be4d1ee6e4c3ddc3a9ea4ad26 /src/include/optimizer/pathnode.h
parentb7883d7e3a1d7d3d98b2bd8186ddf60011d45bdd (diff)
Revise generation of hashjoin paths: generate one path per
hashjoinable clause, not one path for a randomly-chosen element of each set of clauses with the same join operator. That is, if you wrote SELECT ... WHERE t1.f1 = t2.f2 and t1.f3 = t2.f4, and both '=' ops were the same opcode (say, all four fields are int4), then the system would either consider hashing on f1=f2 or on f3=f4, but it would *not* consider both possibilities. Boo hiss. Also, revise estimation of hashjoin costs to include a penalty when the inner join var has a high disbursion --- ie, the most common value is pretty common. This tends to lead to badly skewed hash bucket occupancy and way more comparisons than you'd expect on average. I imagine that the cost calculation still needs tweaking, but at least it generates a more reasonable plan than before on George Young's example.
Diffstat (limited to 'src/include/optimizer/pathnode.h')
-rw-r--r--src/include/optimizer/pathnode.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/include/optimizer/pathnode.h b/src/include/optimizer/pathnode.h
index b38284ccbe1..aa5be0661e3 100644
--- a/src/include/optimizer/pathnode.h
+++ b/src/include/optimizer/pathnode.h
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: pathnode.h,v 1.19 1999/07/30 04:07:22 tgl Exp $
+ * $Id: pathnode.h,v 1.20 1999/08/06 04:00:13 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -33,9 +33,9 @@ extern MergePath *create_mergejoin_path(RelOptInfo *joinrel, int outersize,
List *mergeclauses, List *outersortkeys, List *innersortkeys);
extern HashPath *create_hashjoin_path(RelOptInfo *joinrel, int outersize,
- int innersize, int outerwidth, int innerwidth, Path *outer_path,
- Path *inner_path, List *pathkeys, Oid operator, List *hashclauses,
- List *outerkeys, List *innerkeys);
+ int innersize, int outerwidth, int innerwidth, Path *outer_path,
+ Path *inner_path, List *pathkeys, Oid operator, List *hashclauses,
+ List *outerkeys, List *innerkeys, Cost innerdisbursion);
/*
* prototypes for rel.c