Skip to content

Commit dffbbb3

Browse files
committed
Forgot that I had intended to replace division by masking in hash calculation.
1 parent 8264cbc commit dffbbb3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/backend/executor/nodeHash.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/nodeHash.c,v 1.89 2005/03/06 22:15:04 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/nodeHash.c,v 1.90 2005/03/13 19:59:40 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -709,7 +709,8 @@ ExecHashGetBucketAndBatch(HashJoinTable hashtable,
709709
if (nbatch > 1)
710710
{
711711
*bucketno = hashvalue % nbuckets;
712-
*batchno = (hashvalue / nbuckets) % nbatch;
712+
/* since nbatch is a power of 2, can do MOD by masking */
713+
*batchno = (hashvalue / nbuckets) & (nbatch - 1);
713714
}
714715
else
715716
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy