Re: pgbench - add pseudo-random permutation function
Suzuki Hironobu <hironobu@interdb.jp>
From: Hironobu SUZUKI <hironobu@interdb.jp>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Fabien COELHO <coelho@cri.ensmp.fr>
Date: 2018-10-23T10:11:32Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
pgbench: Function to generate random permutations.
- 6b258e3d688d 14.0 landed
-
Add basic support for using the POPCNT and SSE4.2s LZCNT opcodes
- 711bab1e4d19 12.0 cited
-
Further improve code for probing the availability of ARM CRC instructions.
- a7a7387575b8 11.0 cited
Attachments
- pgbench-prp-func-9.patch (text/plain) patch
Hello, > Also, the alternate implementation should not change the result, so > something looks amiss in your version. Moreover, I'm unclear how to > implement an overflow multiply with the safe no overflow version. (snip) I made an honest mistake. I had assumed the modulo number of Knuth's LCG is (2 ^ 64 - 1). BTW, I found other overflow issue. In pseudorandom_perm(), `modular_multiply() + (key >> LCG_SHIFT)` may overflow if the result of modular_multiply() is large. Therefore, I've improved it. Also, I've simplified Step 5 in modular_multiply(). I attached pgbench-prp-func-9.patch. Best regards,