Re: UUID v7

Поиск
Список
Период
Сортировка
От Andrey M. Borodin
Тема Re: UUID v7
Дата
Msg-id 3BDCCF0B-9C96-416C-87F6-071ABD7AED8B@yandex-team.ru
обсуждение исходный текст
Ответ на Re: UUID v7  ("Andrey M. Borodin" <x4mmm@yandex-team.ru>)
Ответы Re: UUID v7  ("Andrey M. Borodin" <x4mmm@yandex-team.ru>)
Список pgsql-hackers

> On 20 Aug 2023, at 23:56, Andrey M. Borodin <x4mmm@yandex-team.ru> wrote:
>
> <v4-0001-Implement-UUID-v7-as-per-IETF-draft.patch>

I've observed, that pre-generating and buffering random numbers makes UUID generation 10 times faster.

Without buffering
postgres=# with x as (select gen_uuid_v7() from generate_series(1,1e6)) select count(*) from x;
Time: 5286.572 ms (00:05.287)

With buffering
postgres=# with x as (select gen_uuid_v7() from generate_series(1,1e6)) select count(*) from x;
Time: 390.091 ms

This can speed up gen_random_uuid() on the same scale too. PFA implementation of this technique.


Best regards, Andrey Borodin.

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dean Rasheed
Дата:
Сообщение: Re: [PATCH] Add function to_oct
Следующее
От: Daniel Gustafsson
Дата:
Сообщение: Re: [dsm] comment typo