diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-03-06 22:15:05 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-03-06 22:15:05 +0000 |
commit | 849074f9ae422c64501bb1d53ef840de870bf65c (patch) | |
tree | 9ac33ca6df68410da184659a4b0ca67f7bdf8bef /src/include/executor/nodeHash.h | |
parent | 31b6d840f6fdbf3d272e7bf8ec0461742edcdd46 (diff) |
Revise hash join code so that we can increase the number of batches
on-the-fly, and thereby avoid blowing out memory when the planner has
underestimated the hash table size. Hash join will now obey the
work_mem limit with some faithfulness. Per my recent proposal
(hash aggregate part isn't done yet though).
Diffstat (limited to 'src/include/executor/nodeHash.h')
-rw-r--r-- | src/include/executor/nodeHash.h | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/include/executor/nodeHash.h b/src/include/executor/nodeHash.h index 781cfcf8383..06d73c060ec 100644 --- a/src/include/executor/nodeHash.h +++ b/src/include/executor/nodeHash.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/executor/nodeHash.h,v 1.35 2004/12/31 22:03:29 pgsql Exp $ + * $PostgreSQL: pgsql/src/include/executor/nodeHash.h,v 1.36 2005/03/06 22:15:05 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -25,18 +25,20 @@ extern void ExecReScanHash(HashState *node, ExprContext *exprCtxt); extern HashJoinTable ExecHashTableCreate(Hash *node, List *hashOperators); extern void ExecHashTableDestroy(HashJoinTable hashtable); extern void ExecHashTableInsert(HashJoinTable hashtable, - ExprContext *econtext, - List *hashkeys); -extern int ExecHashGetBucket(HashJoinTable hashtable, - ExprContext *econtext, - List *hashkeys); -extern int ExecHashGetBatch(int bucketno, HashJoinTable hashtable); -extern HeapTuple ExecScanHashBucket(HashJoinState *hjstate, List *hjclauses, - ExprContext *econtext); -extern void ExecHashTableReset(HashJoinTable hashtable, long ntuples); + HeapTuple tuple, + uint32 hashvalue); +extern uint32 ExecHashGetHashValue(HashJoinTable hashtable, + ExprContext *econtext, + List *hashkeys); +extern void ExecHashGetBucketAndBatch(HashJoinTable hashtable, + uint32 hashvalue, + int *bucketno, + int *batchno); +extern HeapTuple ExecScanHashBucket(HashJoinState *hjstate, + ExprContext *econtext); +extern void ExecHashTableReset(HashJoinTable hashtable); extern void ExecChooseHashTableSize(double ntuples, int tupwidth, - int *virtualbuckets, - int *physicalbuckets, + int *numbuckets, int *numbatches); #endif /* NODEHASH_H */ |