Re: [HACKERS] [WIP] Zipfian distribution in pgbench

Alik Khilazhev <a.khilazhev@postgrespro.ru>

From: Alik Khilazhev <a.khilazhev@postgrespro.ru>
To: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: PostgreSQL Developers <pgsql-hackers@postgresql.org>
Date: 2017-11-20T15:16:59Z
Lists: pgsql-hackers

Attachments

> Patch applies with "patch", but not with "git apply", probably because it is in CR-NL eol format. No big deal.
> 
> Documentation has been switched from SGML to XML, so now tags must be explicitely closed, i.e. use <foo>x</foo> instead of <foo>x</>.
> 
> Patch compiles with a warning:
> 
> Declaration must move before assertion.
> 
> "array overflow on \random_zipfian" remove spurious "\".

Fixed.

> The random_zipfian(1,100,2) call result is not tested.

I have reduced range to [1, 10] and updated the test. 

> "1 times" -> "once”.

I am not sure that it need to be fixed in this way, because there can be another number instead of 1.
So, I updated it to “%d time(s)”

Commits

  1. Add approximated Zipfian-distributed random generator to pgbench.