Re: UUID v7

From: Sergey Prokhorenko <sergeyprokhorenko(at)yahoo(dot)com(dot)au>
To: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
Cc: Daniel Verite <daniel(at)manitou-mail(dot)org>, Peter Eisentraut <peter(at)eisentraut(dot)org>, Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>, Przemysław Sztoch <przemyslaw(at)sztoch(dot)pl>, Michael Paquier <michael(at)paquier(dot)xyz>, Aleksander Alekseev <aleksander(at)timescale(dot)com>, Pgsql-Hackers Mailing List <pgsql-hackers(at)postgresql(dot)org>, "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>, Stepan Neretin <sncfmgg(at)gmail(dot)com>
Subject: Re: UUID v7
Date: 2025-02-02 19:40:17
Message-ID: 318966956.6330523.1738525217838@mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Dearcolleagues,

I wouldlike to present for discussion my attached new draft documentation on UUIDfunctions (Section 9.14. UUID Functions), which replaces the previouslyproposed draft at https://www.postgresql.org/docs/devel/functions-uuid.html.I have preserved and significantly supplemented the text that was there.

I have thefollowing goals:

1. Statethat from now on, the function uuidv7(), rather than autoincrement, is thedefault choice for generating primary keys

2. Describethe advantages of uuidv7() over autoincrement and uuidv4()

3. Refutethe often-cited imaginary disadvantages of UUIDv7 compared to autoincrement,such as:

   - Lower performance (see the refutation inthe article "UUID Benchmark War" https://ardentperf.com/2024/02/03/uuid-benchmark-war/)

   - Disclosure of date and time of recordcreation in the table (in reality, the timestamp offset parameter distorts thisinformation)

4. Confirm thefault tolerance of the uuidv7() function in all possible critical situations,namely:

   - System clock failure

   - Receiving an invalid value of the offsetargument, which would result in a timestamp overflow or a negative timestamp

 

Regards,

SergeyProkhorenko

sergeyprokhorenko(at)yahoo(dot)com(dot)au

Attachment Content-Type Size
UUID Functions.docx application/vnd.openxmlformats-officedocument.wordprocessingml.document 26.0 KB
UUID Functions.sgml application/octet-stream 8.0 KB

In response to

  • Re: UUID v7 at 2025-02-02 10:15:26 from Andrey Borodin

Responses

  • Re: UUID v7 at 2025-02-04 22:06:22 from Masahiko Sawada

Browse pgsql-hackers by date

  From Date Subject
Next Message Nikita Malakhov 2025-02-02 19:43:43 Re: SQL/JSON json_table plan clause
Previous Message Ilia Evdokimov 2025-02-02 18:46:25 [PATCH] Fix incorrect range in pg_regress comment