Re: random() generates collisions too early

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: Honza Horak <hhorak(at)redhat(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: random() generates collisions too early
Date: 2013-10-21 15:14:06
Message-ID: 29392.1382368446@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Heikki Linnakangas <hlinnakangas(at)vmware(dot)com> writes:
> On 18.10.2013 14:55, Honza Horak wrote:
>> The results covered only 181383 distinct values, and 68 values
>> repeated four or five times each. We should at least consider using a
>> higher-entropy seed.

> Interesting. PostgreSQL's random() function just calls the underlying
> libc random() function. I assume you tested this on with Linux and glibc.

I agree with the theory that this probably isn't the fault of the random()
function as such, but with our code to reset the random seed when forking
a postmaster child process. Note that the test case is only examining the
first random value created in each process. So basically what this is
measuring is the number of different seed values we use.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message bentzi.mor 2013-10-21 16:48:43 BUG #8544: High nfs getattr
Previous Message Stephen Frost 2013-10-21 14:47:26 Re: array_agg() on a set larger than some arbitrary(?) limit causes runaway memory usage and eventually memory exhaustion