提交 dffbbb3e 编写于 作者: T Tom Lane

Forgot that I had intended to replace division by masking in hash calculation.

上级 8264cbcb
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/executor/nodeHash.c,v 1.89 2005/03/06 22:15:04 tgl Exp $ * $PostgreSQL: pgsql/src/backend/executor/nodeHash.c,v 1.90 2005/03/13 19:59:40 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -709,7 +709,8 @@ ExecHashGetBucketAndBatch(HashJoinTable hashtable, ...@@ -709,7 +709,8 @@ ExecHashGetBucketAndBatch(HashJoinTable hashtable,
if (nbatch > 1) if (nbatch > 1)
{ {
*bucketno = hashvalue % nbuckets; *bucketno = hashvalue % nbuckets;
*batchno = (hashvalue / nbuckets) % nbatch; /* since nbatch is a power of 2, can do MOD by masking */
*batchno = (hashvalue / nbuckets) & (nbatch - 1);
} }
else else
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册