Re: pgbench - add pseudo-random permutation function

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Hironobu SUZUKI <hironobu(at)interdb(dot)jp>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgbench - add pseudo-random permutation function
Date: 2018-09-16 20:05:28
Message-ID: alpine.DEB.2.21.1809162200180.1834@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello Hironobu-san,

Here is a v4, based on our out-of-list discussion:
- the mask function is factored out
- the popcount builtin is used if available

> Attached a v3, based on your fix, plus some additional changes:
> - explicitly declare unsigned variables where appropriate, to avoid casts
> - use smaller 24 bits primes instead of 27-29 bits
> - add a shortcut for multiplier below 24 bits and y value below 40 bits,
> which should avoid the manually implemented multiplication in most
> practical cases (tables with over 2^40 rows are pretty rare...).
> - change the existing shortcut to look a the number of bits instead of
> using 32 limits.
> - add a test for minimal code coverage with over 40 bits sizes
> - attempt to improve the documentation
> - some comments were updates, hopefully for the better

--
Fabien.

Attachment Content-Type Size
pgbench-prp-func-4.patch text/x-diff 18.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-09-16 20:13:00 Re: XMLNAMESPACES (was Re: Clarification of nodeToString() use cases)
Previous Message farjad.farid 2018-09-16 19:35:06 RE: Code of Conduct plan