Re: pgsql: Increase the number of possible random seeds per time period.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Munro <tmunro(at)postgresql(dot)org>
Cc: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Increase the number of possible random seeds per time period.
Date: 2018-11-15 03:38:35
Message-ID: 14712.1542253115@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Thomas Munro <tmunro(at)postgresql(dot)org> 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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Thomas Munro 2018-11-15 03:59:15 Re: pgsql: Increase the number of possible random seeds per time period.
Previous Message Thomas Munro 2018-11-15 03:28:36 pgsql: Increase the number of possible random seeds per time period.