Re: [Proposal] global sequence implemented by snowflake ID

2023-12-01 Thread Tomas Vondra
On 12/1/23 07:15, Amit Kapila wrote: > On Thu, Nov 30, 2023 at 5:21 PM Tomas Vondra > wrote: >> >> On 11/30/23 11:56, Amit Kapila wrote: >> >>> >>> This was the key point that I wanted to discuss or hear opinions >>> about. So, if we wish to have some sort of global sequences then it is >>> not cl

Re: [Proposal] global sequence implemented by snowflake ID

2023-11-30 Thread Amit Kapila
On Thu, Nov 30, 2023 at 5:21 PM Tomas Vondra wrote: > > On 11/30/23 11:56, Amit Kapila wrote: > > > > > This was the key point that I wanted to discuss or hear opinions > > about. So, if we wish to have some sort of global sequences then it is > > not clear to me what benefits will we get by havin

Re: [Proposal] global sequence implemented by snowflake ID

2023-11-30 Thread Michael Paquier
On Thu, Nov 30, 2023 at 12:51:38PM +0100, Tomas Vondra wrote: > As for implementation/replication, I haven't checked the code, but I'd > imagine the AM should be able to decide whether something needs to be > replicated (and how) or not. So the traditional sequences would > replicate, and the alter

Re: [Proposal] global sequence implemented by snowflake ID

2023-11-30 Thread Tomas Vondra
On 11/30/23 11:56, Amit Kapila wrote: > On Thu, Nov 30, 2023 at 6:48 AM Michael Paquier wrote: >> >> On Tue, Nov 28, 2023 at 02:23:44PM +0530, Amit Kapila wrote: >>> It is interesting to see you want to work towards globally distributed >>> sequences. I think it would be important to discuss how a

Re: [Proposal] global sequence implemented by snowflake ID

2023-11-30 Thread Amit Kapila
On Thu, Nov 30, 2023 at 6:48 AM Michael Paquier wrote: > > On Tue, Nov 28, 2023 at 02:23:44PM +0530, Amit Kapila wrote: > > It is interesting to see you want to work towards globally distributed > > sequences. I think it would be important to discuss how and what we > > want to achieve with sequen

RE: [Proposal] global sequence implemented by snowflake ID

2023-11-30 Thread Hayato Kuroda (Fujitsu)
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 no

Re: [Proposal] global sequence implemented by snowflake ID

2023-11-30 Thread Nikita Malakhov
Hi! 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 instance

Re: [Proposal] global sequence implemented by snowflake ID

2023-11-29 Thread Michael Paquier
On Tue, Nov 28, 2023 at 02:23:44PM +0530, Amit Kapila wrote: > It is interesting to see you want to work towards globally distributed > sequences. I think it would be important to discuss how and what we > want to achieve with sequences w.r.t logical replication and or > active-active configuration

Re: [Proposal] global sequence implemented by snowflake ID

2023-11-28 Thread Amit Kapila
On Thu, Nov 23, 2023 at 4:15 PM Michael Paquier wrote: > > On Thu, Nov 23, 2023 at 10:18:59AM +, Hayato Kuroda (Fujitsu) wrote: > > * Implement as a variant of sequence access method. I found that sequence > > AM was > > proposed many years ago [5], but it has not been active now. It might

Re: [Proposal] global sequence implemented by snowflake ID

2023-11-23 Thread Michael Paquier
On Thu, Nov 23, 2023 at 10:18:59AM +, Hayato Kuroda (Fujitsu) wrote: > * Implement as a variant of sequence access method. I found that sequence AM > was > proposed many years ago [5], but it has not been active now. It might be a > fundamental way but needs a huge works. Well, that's wha