diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-03-21 00:04:40 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-03-21 00:04:40 +0000 |
commit | 596efd27edce20bba706f50de99a0f15bcc2a567 (patch) | |
tree | 63c07c3c310e1b072f0a29a79220c81254dba3d8 /src/include/executor/nodeHash.h | |
parent | 249d936bed069877923f0369bd2ce51a6f8f925e (diff) | |
download | postgresql-596efd27edce20bba706f50de99a0f15bcc2a567.tar.gz postgresql-596efd27edce20bba706f50de99a0f15bcc2a567.zip |
Optimize multi-batch hash joins when the outer relation has a nonuniform
distribution, by creating a special fast path for the (first few) most common
values of the outer relation. Tuples having hashvalues matching the MCVs
are effectively forced to be in the first batch, so that we never write
them out to the batch temp files.
Bryce Cutt and Ramon Lawrence, with some editorialization by me.
Diffstat (limited to 'src/include/executor/nodeHash.h')
-rw-r--r-- | src/include/executor/nodeHash.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/include/executor/nodeHash.h b/src/include/executor/nodeHash.h index ae08880d6d3..7c8ca568a6d 100644 --- a/src/include/executor/nodeHash.h +++ b/src/include/executor/nodeHash.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/executor/nodeHash.h,v 1.46 2009/01/01 17:23:59 momjian Exp $ + * $PostgreSQL: pgsql/src/include/executor/nodeHash.h,v 1.47 2009/03/21 00:04:40 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -41,8 +41,10 @@ extern void ExecHashGetBucketAndBatch(HashJoinTable hashtable, extern HashJoinTuple ExecScanHashBucket(HashJoinState *hjstate, ExprContext *econtext); extern void ExecHashTableReset(HashJoinTable hashtable); -extern void ExecChooseHashTableSize(double ntuples, int tupwidth, +extern void ExecChooseHashTableSize(double ntuples, int tupwidth, bool useskew, int *numbuckets, - int *numbatches); + int *numbatches, + int *num_skew_mcvs); +extern int ExecHashGetSkewBucket(HashJoinTable hashtable, uint32 hashvalue); #endif /* NODEHASH_H */ |