Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gN8UM-0002FE-Lv for pgsql-committers@arkaria.postgresql.org; Thu, 15 Nov 2018 03:38:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gN8UL-0000Tj-0q for pgsql-committers@arkaria.postgresql.org; Thu, 15 Nov 2018 03:38:41 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gN8UK-0000Tc-OJ for pgsql-committers@lists.postgresql.org; Thu, 15 Nov 2018 03:38:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gN8UI-0006Bf-5S; Thu, 15 Nov 2018 03:38:39 +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 wAF3cZfF014713; Wed, 14 Nov 2018 22:38:35 -0500 From: Tom Lane To: Thomas Munro cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Increase the number of possible random seeds per time period. In-reply-to: References: Comments: In-reply-to Thomas Munro message dated "Thu, 15 Nov 2018 03:28:36 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <14711.1542253115.1@sss.pgh.pa.us> Date: Wed, 14 Nov 2018 22:38:35 -0500 Message-ID: <14712.1542253115@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thomas Munro writes: > Increase the number of possible random seeds per time period. Um, this bit is *not* right: + ((unsigned int) MyStartTimestamp >> 20)); You're cutting it down to 32 bits and then right shifting, which means you are shifting in a lot of zeroes when you could be shifting in something that's not quite as predetermined. I had in mind to do the shifts in uint64 arithmetic and then narrow the final XOR result to int (maybe let the compiler do that implicitly). regards, tom lane