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

Поиск
Список
Период
Сортировка
От Alik Khilazhev
Тема Re: [HACKERS] [WIP] Zipfian distribution in pgbench
Дата
Msg-id 5FD3F866-CA30-4634-9D48-DE669A84248C@postgrespro.ru
обсуждение исходный текст
Ответ на Re: [HACKERS] [WIP] Zipfian distribution in pgbench  (Fabien COELHO <coelho@cri.ensmp.fr>)
Ответы Re: [HACKERS] [WIP] Zipfian distribution in pgbench  (Fabien COELHO <coelho@cri.ensmp.fr>)
Список pgsql-hackers
Hello Fabien,

>
> I think that this method should be used for a>1, and the other very rough one can be kept for parameter a in [0, 1),
acase which does not make much sense to a mathematician as it diverges if unbounded. 

Now “a” does not have upper bound, that’s why on using iterative algorithm with a >= 10000 program will stuck on
infiniteloop because of following line of code: 
double b = pow(2.0, s - 1.0);
Because after overflow “b” becomes “+Inf”.

So should upper bound for “a" be set?

Should I mention in docs that there are two algorithms are used depending on values of a(s/theta)?

In attaching patch, I have added computeIterativeZipfian method and it’s usage in getZipfianRand.
Is it better to move code of computing via cache to new method, so that getZipfianRand will contain only 2
computeXXXZipfianmethod calls? 
—
Thanks and Regards,
Alik Khilazhev
Postgres Professional:
http://www.postgrespro.com
The Russian Postgres Company


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Gavin Flower
Дата:
Сообщение: Re: [HACKERS] Patches I'm thinking of pushing shortly
Следующее
От: Christoph Berg
Дата:
Сообщение: [HACKERS] initdb failure on Debian sid/mips64el in EventTriggerEndCompleteQuery