Re: random() generates collisions too early - Mailing list pgsql-bugs

From Tom Lane
Subject Re: random() generates collisions too early
Date
Msg-id 29392.1382368446@sss.pgh.pa.us
Whole thread Raw
In response to Re: random() generates collisions too early  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Responses Re: random() generates collisions too early  (Honza Horak <hhorak@redhat.com>)
List pgsql-bugs
Heikki Linnakangas <hlinnakangas@vmware.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

pgsql-bugs by date:

Previous
From: Stephen Frost
Date:
Subject: Re: array_agg() on a set larger than some arbitrary(?) limit causes runaway memory usage and eventually memory exhaustion
Next
From: Joe Van Dyk
Date:
Subject: Re: random() generates collisions too early