Re: UUID v7
От | Andrey M. Borodin |
---|---|
Тема | Re: UUID v7 |
Дата | |
Msg-id | FFDEE01F-7E3B-4DCC-8830-F722307C2412@yandex-team.ru обсуждение исходный текст |
Ответ на | Re: UUID v7 (Peter Eisentraut <peter@eisentraut.org>) |
Ответы |
Re: UUID v7
|
Список | pgsql-hackers |
> On 19 Mar 2024, at 13:55, Peter Eisentraut <peter@eisentraut.org> wrote: > > On 16.03.24 18:43, Andrey M. Borodin wrote: >>> On 15 Mar 2024, at 14:47, Aleksander Alekseev <aleksander@timescale.com> wrote: >>> >>> +1 to the idea. I doubt that anyone will miss it. >> PFA v22. >> Changes: >> 1. Squashed all editorialisation by Jelte >> 2. Fixed my erroneous comments on using Method 2 (we are using method 1 instead) >> 3. Remove all traces of uuid_extract_variant() > > I have committed a subset of this for now, namely the additions of uuid_extract_timestamp() and uuid_extract_version(). These seemed mature and agreed upon. You can rebase the rest of your patch on top of that. Great! Thank you! PFA v23 with rebase on HEAD. > I have started a separate discussion to learn about the precision we can expect from gettimeofday(). Even in presence of real microsecond-enabled and portable timer using microseconds does not seem to me an optimal way ofutilising UUID bits. Timer-based bits contribute to global sortability. But the real timers we have are not even millisecond adjusted. We canhope for ~few ms variation in one datacenter or in presence of atomic clocks. Time-based bits contribute to global uniqueness, but certainly they are not that effective as counter bits. Time-based bits do not provide local sortability guarantees: some UUIDs might get same microseconds or be affected by leapbackwards. I think that microseconds are good only for hardware-specific solutions, not for something that runs on variety of platforms,OSes, devices. Best regards, Andrey Borodin.
Вложения
В списке pgsql-hackers по дате отправления: