Re: UUID v7

Поиск
Список
Период
Сортировка
От Andrey M. Borodin
Тема Re: UUID v7
Дата
Msg-id 84D20D0F-B5FF-41CD-9F48-E282CE9FEC1D@yandex-team.ru
обсуждение исходный текст
Ответ на Re: UUID v7  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Ответы Re: UUID v7  ("Andrey M. Borodin" <x4mmm@yandex-team.ru>)
Список pgsql-hackers


On 10 Jul 2023, at 21:50, Peter Eisentraut <peter.eisentraut@enterprisedb.com> wrote:

I suggest we keep this thread to v7, which has pretty straightforward semantics for PostgreSQL.  v8 by definition has many possible implementations, so you're going to have to make pretty strong arguments that yours is the best and only one, if you are going to claim the gen_uuid_v8 function name.

Thanks Peter, I'll follow this course of action.

After discussion on GitHub with Sergey Prokhorenko [0] I understood that counter is optional, but useful part of UUID v7. It actually promotes sortability of data generated at high speed.
The standard does not specify how big counter should be. PFA patch with 16 bit counter. Maybe it worth doing 18bit counter - it will save us one byte of PRNG data. Currently we only take 2 bits out of the whole random byte.


Best regards, Andrey Borodin.


Вложения

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

Предыдущее
От: John Naylor
Дата:
Сообщение: Re: Avoid undefined behavior with msvc compiler (src/include/port/pg_bitutils.h)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Avoid undefined behavior with msvc compiler (src/include/port/pg_bitutils.h)