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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pgsql: Increase the number of possible random seeds per time period.
Дата
Msg-id 14712.1542253115@sss.pgh.pa.us
обсуждение исходный текст
Ответ на pgsql: Increase the number of possible random seeds per time period.  (Thomas Munro <tmunro@postgresql.org>)
Ответы Re: pgsql: Increase the number of possible random seeds per time period.  (Thomas Munro <thomas.munro@enterprisedb.com>)
Список pgsql-committers
Thomas Munro <tmunro@postgresql.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


В списке pgsql-committers по дате отправления:

Предыдущее
От: Thomas Munro
Дата:
Сообщение: pgsql: Increase the number of possible random seeds per time period.
Следующее
От: Thomas Munro
Дата:
Сообщение: Re: pgsql: Increase the number of possible random seeds per time period.