Re: UUID v7 - Mailing list pgsql-hackers

From Andrey M. Borodin
Subject Re: UUID v7
Date
Msg-id F91948DD-500A-4A22-ABB9-5F4C59C28851@yandex-team.ru
Whole thread Raw
In response to Re: UUID v7  ("Andrey M. Borodin" <x4mmm@yandex-team.ru>)
Responses Re: UUID v7
List pgsql-hackers

> On 30 Jul 2023, at 13:08, Andrey M. Borodin <x4mmm@yandex-team.ru> wrote:
>
>
> 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. 
>

Here's a new patch version. Now counter is initialised with strong random on every time change (each ms). However, one
firstbit of the counter is preserved to zero. This is done to extend counter capacity (I left comments with reference
toRFC with explanations). 

Thanks!

Best regards, Andrey Borodin.

Attachment

pgsql-hackers by date:

Previous
From: Chapman Flack
Date:
Subject: datetime from a JsonbValue
Next
From: Peter Geoghegan
Date:
Subject: Re: POC, WIP: OR-clause support for indexes