Re: [HACKERS] [WIP] Zipfian distribution in pgbench
От | Alik Khilazhev |
---|---|
Тема | Re: [HACKERS] [WIP] Zipfian distribution in pgbench |
Дата | |
Msg-id | 35FF9C7A-0ED8-4BDD-8C66-5A095785D090@postgrespro.ru обсуждение исходный текст |
Ответ на | Re: [HACKERS] [WIP] Zipfian distribution in pgbench (Fabien COELHO <coelho@cri.ensmp.fr>) |
Список | pgsql-hackers |
Hello Fabien, > On 5 Aug 2017, at 12:15, Fabien COELHO <coelho@cri.ensmp.fr> wrote: > > > Hello Alik, > > I've done some math investigations, which consisted in spending one hour with Christian, a statistician colleague of mine.He took an old book out of a shelf, opened it to page 550 (roughly in the middle), and explained to me how to builda real zipfian distribution random generator. > > The iterative method is for parameter a>1 and works for unbounded values. It is simple to add a bound. In practice theiterative method is quite effective, i.e. number of iterations is typically small, at least if the bound is large andif parameter a is not too close to 1. > I've attached a python3 script which implements the algorithm. It looks like magic. Beware that a C implementation shouldtake care of float and int overflows. > Thank you for the script. I will rewrite it to C and add to the patch soon. — Thanks and Regards, Alik Khilazhev Postgres Professional: http://www.postgrespro.com The Russian Postgres Company
В списке pgsql-hackers по дате отправления: