RE: [Proposal] global sequence implemented by snowflake ID

Поиск
Список
Период
Сортировка
От Hayato Kuroda (Fujitsu)
Тема RE: [Proposal] global sequence implemented by snowflake ID
Дата
Msg-id TY3PR01MB9889C4ED12BF54BA4FF59919F582A@TY3PR01MB9889.jpnprd01.prod.outlook.com
обсуждение исходный текст
Ответ на Re: [Proposal] global sequence implemented by snowflake ID  (Nikita Malakhov <hukutoc@gmail.com>)
Список pgsql-hackers
Dear Nikita,

Thanks for reading my patch!

>
I have reviewed the patch in this topic and have a question mentioning the machine ID -
INSERT INTO snowflake_sequence.machine_id
    SELECT round((random() * (0 - 511))::numeric, 0) + 511;

This kind of ID generation does not seem to guarantee from not having the same ID in a pool
of instances, does it?
>

You are right. For now the part is randomly assigned, but it might be duplicated on another instance.
Maybe we should provide a way for setting it manually. Or, we may able to use another way
for determining machine ID.
(system_identifier is too long to use here...)

Note that the contrib module was provided just for the reference. We are now
discussing high-level items, like needs, use-cases and approaches. Could you
please your opinion around here if you have?

The implementation may be completely changed, so I did not change yet. Of course,
your comment is quite helpful so that it will be handled eventually.

Best Regards,
Hayato Kuroda
FUJITSU LIMITED


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

Предыдущее
От: Andrei Lepikhov
Дата:
Сообщение: Re: POC, WIP: OR-clause support for indexes
Следующее
От: John Naylor
Дата:
Сообщение: Re: [dynahash] do not refill the hashkey after hash_search