Re: Отв.: Re: UUID v7
Kirill Reshke <reshkekirill@gmail.com>
From: Kirill Reshke <reshkekirill@gmail.com>
To: Sergey Prokhorenko <sergeyprokhorenko@yahoo.com.au>
Cc: "Andrey M. Borodin" <x4mmm@yandex-team.ru>, Peter Eisentraut <peter@eisentraut.org>, Masahiko Sawada <sawada.mshk@gmail.com>, 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: 2024-11-29T04:22:47Z
Lists: pgsql-hackers
On Fri, 29 Nov 2024, 09:14 Sergey Prokhorenko, < sergeyprokhorenko@yahoo.com.au> wrote: > I mean to add not benchmark results to the patch, but functions so that > everyone can compare themselves on their equipment. The comparison with > UUIDv4 is not very interesting, as the choice is usually between UUIDv7 and > an integer key. And I have described many use cases, and in your benchmark > there is only one, the simplest. > > > Отправлено из Yahoo Почты на iPhone > <https://mail.onelink.me/107872968?pid=nativeplacement&c=Global_Acquisition_YMktg_315_Internal_EmailSignature&af_sub1=Acquisition&af_sub2=Global_YMktg&af_sub3=&af_sub4=100000604&af_sub5=EmailSignature__Static_> > > Пользователь четверг, ноября 28, 2024, 11:09 AM написал Andrey M. Borodin < > x4mmm@yandex-team.ru>: > > > > > On 28 Nov 2024, at 04:07, Sergey Prokhorenko < > sergeyprokhorenko@yahoo.com.au> wrote: > > > > It would be useful to add a standard comparative benchmark with several > parameters and use cases to the patch, so that IT departments can compare > UUIDv7, ULID, UUIDv4, Snowflake ID and BIGSERIAL for their hardware and > conditions. > > > > I know for a fact that IT departments make such benchmarks of low > quality. They usually measure the generation rate, which is meaningless > because it is usually excessive. It makes sense to measure the rate of > single-threaded and multi-threaded insertion of a large number of records > (with and without partitioning), as well as the rate of execution of > queries to join big tables, to update or delete a large number of records. > It is important to measure memory usage, processor load, etc. > > > Publishing benchmarks seems to be far beyond what our documentation go > for. Mostly, because benchmarks are tricky. You can prove anything with > benchmarks. > > Everyone is welcome to publish benchmark results in their blogs, but IMO > docs have a very different job to do. > > I’ll just publish one benchmark in this mailing list. With patch v39 > applied on my MB Air M2 I get: > > postgres=# create table table_for_uuidv4(id uuid primary key); > CREATE TABLE > Time: 9.479 ms > postgres=# insert into table_for_uuidv4 select uuidv4() from > generate_series(1,3e7); > INSERT 0 30000000 > Time: 2003918.770 ms (33:23.919) > postgres=# create table table_for_uuidv7(id uuid primary key); > CREATE TABLE > Time: 3.930 ms > postgres=# insert into table_for_uuidv7 select uuidv7() from > generate_series(1,3e7); > INSERT 0 30000000 > Time: 337001.315 ms (05:37.001) > > Almost an order of magnitude better :) > > > Best regards, Andrey Borodin. > > Hi! Do not top-post on this list >
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