Re: Sequential UUID Generation

Поиск
Список
Период
Сортировка
От Uday Bhaskar V
Тема Re: Sequential UUID Generation
Дата
Msg-id CAFowjW2QcUx-xhEXTMi=6QbeBCNjjttYzVyunv+Tv7s9PmE=hA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Sequential UUID Generation  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Ответы Re: Sequential UUID Generation
Список pgsql-hackers
Thanks Tomas! I will try.

Regards,
Uday

On Tue, Oct 30, 2018 at 6:43 PM Tomas Vondra <tomas.vondra@2ndquadrant.com> wrote:
I don't think PostgreSQL has anything like that at the moment. It would
not be difficult to tweak the UUID generator to generate sequential (or
monotonic) values, the tricky part seems to be durability requirements.

One idea would be to simply store the value in (shared) memory, but that
would mean losing the state on restart/crash, so there would need to be
some sort of protection against generating duplicate values (say, using
postmaster timestamp as the first 64 bits of the UUID).

Another idea is to piggy-back this on bigint sequence somehow - split
the 128bit range into 64+64, use the sequence value for the first 64b
and pick the other half by random. That would guarantee both uniqueness,
monotonicity and durability. And it would also be fairly random, making
it difficult to guess UUIDs.

regards

On 10/29/2018 04:06 PM, Uday Bhaskar V wrote:
> Hi,
>
>  We have migrated from Oracle to Postgres, there because of the
> replication requirements we used UUID columns.
> I did a POC(in postgres) with sequential UUID against Non sequential
> which has shown lot of different in space utilization and index size.
> Sql server has "newsequentialid" which generates sequential UUID.  I
> need similar functionality here. 
> I want to create a function which generates a sequential UUIDs, Any
> suggestions or support would be much appreciated.   
>
> Thanks,
> Uday

--
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

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

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: Sequential UUID Generation
Следующее
От: Michael Banck
Дата:
Сообщение: Re: Online verification of checksums