Re: UUID v7

From: Aleksander Alekseev <aleksander(at)timescale(dot)com>
To: pgsql-hackers mailing list <pgsql-hackers(at)postgresql(dot)org>
Cc: "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>, Nikolay Samokhvalov <nik(at)postgres(dot)ai>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Przemysław Sztoch <przemyslaw(at)sztoch(dot)pl>, Sergey Prokhorenko <sergeyprokhorenko(at)yahoo(dot)com(dot)au>, Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>, Nick Babadzhanian <pgnickb(at)gmail(dot)com>, Mat Arye <mat(at)timescaledb(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Daniel Gustafsson <daniel(at)yesql(dot)se>, Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Nikolay Samokhvalov <samokhvalov(at)gmail(dot)com>, "Kyzer Davis (kydavis)" <kydavis(at)cisco(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, "brad(at)peabody(dot)io" <brad(at)peabody(dot)io>, Kirk Wolak <wolakk(at)gmail(dot)com>
Subject: Re: UUID v7
Date: 2024-01-24 15:46:14
Message-ID: CAJ7c6TPo8Pe8vWzum5g4m8PdXMO=ftRCmpaYnhXmovsepYQ1CA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

> Also, please not that uuidv7(time+1us) and uuidv7(time) will have the same internal timestamp, so despite time+1us > time, still second uuid will be greater.
>
> Both invariants you proposed cannot be reasonably guaranteed. Upholding any of them greatly reduces usability of UUID v7.

Again, personally I don't insist on the 1us precision [1]. Only the
fact that timestamp from the far past generates UUID from the future
bothers me.

[1]: https://postgr.es/m/CAJ7c6TPCSprWwVNdOB%3D%3DpgKZPqO5q%3DHRgmU7zmYqz9Dz5ffVYw%40mail.gmail.com

--
Best regards,
Aleksander Alekseev

In response to

  • Re: UUID v7 at 2024-01-24 15:29:36 from Andrey M. Borodin

Responses

  • Re: UUID v7 at 2024-01-24 16:54:37 from Andrey M. Borodin

Browse pgsql-hackers by date

  From Date Subject
Next Message Jelte Fennema-Nio 2024-01-24 15:58:17 Re: SSL tests fail on OpenSSL v3.2.0
Previous Message Andrey M. Borodin 2024-01-24 15:29:36 Re: UUID v7