Re: UUID v7
Sergey Prokhorenko <sergeyprokhorenko@yahoo.com.au>
From: Sergey Prokhorenko <sergeyprokhorenko@yahoo.com.au>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Andrey Borodin <x4mmm@yandex-team.ru>, Daniel Verite <daniel@manitou-mail.org>, Peter Eisentraut <peter@eisentraut.org>, Jelte Fennema-Nio <postgres@jeltef.nl>, Przemysław Sztoch <przemyslaw@sztoch.pl>, Michael Paquier <michael@paquier.xyz>, Aleksander Alekseev <aleksander@timescale.com>, Pgsql-Hackers Mailing List <pgsql-hackers@postgresql.org>, "David G. Johnston" <david.g.johnston@gmail.com>, Mat Arye <mat@timescaledb.com>, Matthias van de Meent <boekewurm+postgres@gmail.com>, Nikolay Samokhvalov <samokhvalov@gmail.com>, Junwang Zhao <zhjwpku@gmail.com>, Stepan Neretin <sncfmgg@gmail.com>
Date: 2025-02-08T21:56:27Z
Lists: pgsql-hackers
Attachments
- changed.diff (application/octet-stream)
On Wednesday 5 February 2025 at 01:07:02 am GMT+3, Masahiko Sawada <sawada.mshk@gmail.com> wrote: On Sun, Feb 2, 2025 at 11:41 AM Sergey Prokhorenko <sergeyprokhorenko@yahoo.com.au> wrote: > > Dear colleagues, > > I would like to present for discussion my attached new draft documentation on UUID functions (Section 9.14. UUID Functions), which replaces the previously proposed draft at https://www.postgresql.org/docs/devel/functions-uuid.html. I have preserved and significantly supplemented the text that was there. > > I have the following goals: > > 1. State that from now on, the function uuidv7(), rather than autoincrement, is the default choice for generating primary keys > > 2. Describe the advantages of uuidv7() over autoincrement and uuidv4() > > 3. Refute the often-cited imaginary disadvantages of UUIDv7 compared to autoincrement, such as: > > - Lower performance (see the refutation in the article "UUID Benchmark War" https://ardentperf.com/2024/02/03/uuid-benchmark-war/) > > - Disclosure of date and time of record creation in the table (in reality, the timestamp offset parameter distorts this information) > > 4. Confirm the fault tolerance of the uuidv7() function in all possible critical situations, namely: > > - System clock failure > > - Receiving an invalid value of the offset argument, which would result in a timestamp overflow or a negative timestamp > Thank you for the proposal. Could you share the proposed document as a .diff or .patch file? That would be easier to review the updates. Regards, -- Masahiko Sawada Amazon Web Services: https://aws.amazon.com _________________________________________________________ Dear colleagues, I have attached a file changed.diff containing my proposed changes to the documentation on UUID functions (Section 9.14. UUID Functions). The text of the changes in this file is updated, and it is slightly different from the previously submitted text. Regards, Sergey Prokhorenko sergeyprokhorenko@yahoo.com.au
Commits
-
Fix timestamp overflow in UUIDv7 implementation.
- a5419bc72e22 18.0 landed
-
Add UUID version 7 generation function.
- 78c5e141e9c1 18.0 landed
-
Add some UUID support functions
- 794f10f6b920 17.0 landed