Re: [WIP] Zipfian distribution in pgbench

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Alik Khilazhev <a(dot)khilazhev(at)postgrespro(dot)ru>
Cc: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [WIP] Zipfian distribution in pgbench
Date: 2017-07-14 14:51:51
Message-ID: alpine.DEB.2.20.1707141648040.7871@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> Algorithm works with theta less than 1. The only problem here is that
> theta can not be 1, because of next line of code
>
> cell->alpha = 1. / (1 - theta);
>
> That’s why I put such restriction. Now I see 2 possible solutions for that:
> 1) Exclude 1, and allow everything in range (0;+∞).

Yep.

> 2) Or just increase/decrease theta by very small number if it is 1.

Nope, this seems quite arbitrary.

> I've executed scripts that you attached with different theta and number
> of outcomes(not n, n remains the same = 100) and I found out that for
> theta = 0.1 and big number of outcomes it gives distribution very
> similar to zipfian(for number of outcomes = 100 000, bias -6% to 8% in
> whole range and for NOO = 1000 000, bias is -2% to 2%).

Ok, so you did not get the large bias for i=3. Strange.

> By, number of outcomes(NOO) I mean how many times random_zipfian was
> called. For example: pgbench -f compte_bench.sql -t 100000 So, I think
> it works but works worse for small number of outcomes. And also we need
> to find optimal theta for better results.

Hmmm. I've run one million outcomes each time.

I'll check on the next version.

--
Fabien.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marina Polyakova 2017-07-14 14:54:37 Re: WIP Patch: Pgbench Serialization and deadlock errors
Previous Message Vladimir Borodin 2017-07-14 14:48:17 Re: SCRAM auth and Pgpool-II