Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VYHBM-0000F8-OA for pgsql-bugs@arkaria.postgresql.org; Mon, 21 Oct 2013 15:14:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VYHBM-0007Pz-2e for pgsql-bugs@arkaria.postgresql.org; Mon, 21 Oct 2013 15:14:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VYHBK-0007OD-P2 for pgsql-bugs@postgresql.org; Mon, 21 Oct 2013 15:14:10 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VYHBH-0000Yl-9a for pgsql-bugs@postgresql.org; Mon, 21 Oct 2013 15:14:10 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id r9LFE6ue029393; Mon, 21 Oct 2013 11:14:06 -0400 From: Tom Lane To: Heikki Linnakangas cc: Honza Horak , pgsql-bugs@postgresql.org Subject: Re: random() generates collisions too early In-reply-to: <526537ED.2010607@vmware.com> References: <5261219D.3060205@redhat.com> <526537ED.2010607@vmware.com> Comments: In-reply-to Heikki Linnakangas message dated "Mon, 21 Oct 2013 17:19:25 +0300" Date: Mon, 21 Oct 2013 11:14:06 -0400 Message-ID: <29392.1382368446@sss.pgh.pa.us> X-Pg-Spam-Score: -2.3 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Heikki Linnakangas 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 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs