Re: add modulo (%) operator to pgbench - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: add modulo (%) operator to pgbench
Date
Msg-id alpine.DEB.2.10.1408041110300.18656@sto
Whole thread Raw
In response to add modulo (%) operator to pgbench  (Fabien <coelho@cri.ensmp.fr>)
Responses Re: add modulo (%) operator to pgbench
List pgsql-hackers

> This patch is pretty trivial.

Another slightly less trivial but more useful version.

The issue is that there are 3 definitions of modulo, two of which are fine 
(Knuth floored division and Euclidian), and the last one much less useful. 
Alas, C (%) & SQL (MOD) choose the bad definition:-( I really need any of 
the other two. The attached patch adds all versions, with "%" and "mod" 
consistent with their C and SQL unfortunate counterparts, and "fmod" and 
"emod" the sane ones.

> Add modulo operator to pgbench.
>
> This is useful to compute a permutation for tests with non uniform 
> accesses (exponential or gaussian), so as to avoid trivial correlations 
> between neighbour keys.

-- 
Fabien.

pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Looked at TODO:Considering improving performance of computing CHAR() value lengths
Next
From: Seref Arikan
Date:
Subject: How to manage shared library lifetime through C functions