Re: pgbench - add pseudo-random permutation function

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: David Steele <david(at)pgmasters(dot)net>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Hironobu SUZUKI <hironobu(at)interdb(dot)jp>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgbench - add pseudo-random permutation function
Date: 2021-03-08 10:50:43
Message-ID: alpine.DEB.2.22.394.2103081136490.2754793@pseudo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


>> What are your current thoughts?
>
> Thanks for prodding. I still think it's a useful feature. However I
> don't think I'll have to time to get it done on the current commitfest.
> I suggest to let it sit in the commitfest to see if somebody else will
> pick it up -- and if not, we move it to the next one, with apologies to
> author and reviewers.
>
> I may have time to become familiar or at least semi-comfortable with all
> that weird math in it by then.

Yep.

Generating a parametric good-quality low-cost (but not
cryptographically-secure) pseudo-random permutations on arbitrary sizes
(not juste power of two sizes) is not a trivial task, I had to be quite
creative to achieve it, hence the "weird" maths. I had a lot of bad
not-really-working ideas before the current status of the patch.

The code could be simplified if we assume that PG_INT128_TYPE will be
available on all relevant architectures, and accept the feature not to be
available if not.

--
Fabien.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2021-03-08 10:53:57 Re: Occasional tablespace.sql failures in check-world -jnn
Previous Message vignesh C 2021-03-08 10:49:49 Re: [HACKERS] logical decoding of two-phase transactions