Re: UUID v7

From: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>
To: Aleksander Alekseev <aleksander(at)timescale(dot)com>
Cc: pgsql-hackers mailing list <pgsql-hackers(at)postgresql(dot)org>, "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>, Peter Eisentraut <peter(at)eisentraut(dot)org>, Sergey Prokhorenko <sergeyprokhorenko(at)yahoo(dot)com(dot)au>, Przemysław Sztoch <przemyslaw(at)sztoch(dot)pl>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Mat Arye <mat(at)timescaledb(dot)com>, Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Nikolay Samokhvalov <samokhvalov(at)gmail(dot)com>, Junwang Zhao <zhjwpku(at)gmail(dot)com>
Subject: Re: UUID v7
Date: 2024-03-11 15:56:23
Message-ID: CAGECzQRYit62xO=HqX7kAf8tELjZTsYc0LQ1LStUsaKSPqJu_w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Attached a few comment fixes/improvements and a pgindent run (patch 0002-0004)

Now with the added comments, one thing pops out to me: The comments
mention that we use "Monotonic Random", but when I read the spec that
explicitly recommends against using an increment of 1 when using
monotonic random. I feel like if we use an increment of 1, we're
better off going for the "Fixed-Length Dedicated Counter Bits" method
(i.e. change the code to start the counter at 0). See patch 0005 for
an example of that change.

I'm also wondering if we really want to use the extra rand_b bits for
this. The spec says we MAY, but it does remove the amount of
randomness in our UUIDs.

Attachment Content-Type Size
v21-0001-Implement-UUID-v7.patch application/octet-stream 20.3 KB
v21-0003-Run-pgindent.patch application/octet-stream 7.9 KB
v21-0005-Change-to-Fixed-Length-Dedicated-Counter-Bits.patch application/octet-stream 4.8 KB
v21-0004-Fix-comments-a-bit.patch application/octet-stream 1.8 KB
v21-0002-Fix-typos.patch application/octet-stream 3.5 KB

In response to

  • Re: UUID v7 at 2024-03-11 12:44:58 from Aleksander Alekseev

Responses

  • Re: UUID v7 at 2024-03-11 18:27:43 from Andrey M. Borodin

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2024-03-11 15:59:36 Re: Avoiding inadvertent debugging mode for pgbench
Previous Message Alvaro Herrera 2024-03-11 15:34:31 Re: remaining sql/json patches