Re: Could postgres12 support millions of sequences? (like 10 million)

From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: pabloa98 <pabloa98(at)gmail(dot)com>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Could postgres12 support millions of sequences? (like 10 million)
Date: 2020-03-20 02:01:20
Message-ID: F191BCE8-7D1F-469E-8066-00A5CA0F79DF@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Mar 19, 2020, at 7:35 PM, pabloa98 <pabloa98(at)gmail(dot)com> wrote:
>
>
>
> On Thu, Mar 19, 2020 at 6:16 PM Rob Sargent <robjsargent(at)gmail(dot)com <mailto:robjsargent(at)gmail(dot)com>> wrote:
>
>
>> On Mar 19, 2020, at 6:45 PM, pabloa98 <pabloa98(at)gmail(dot)com <mailto:pabloa98(at)gmail(dot)com>> wrote:
>>
>>
>>
>> On Thu, Mar 19, 2020 at 5:13 PM Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com <mailto:adrian(dot)klaver(at)aklaver(dot)com>> wrote:
>> On 3/19/20 3:32 PM, pabloa98 wrote:
>> >
>> >
>> > On Thu, Mar 19, 2020 at 3:17 PM Rob Sargent <robjsargent(at)gmail(dot)com <mailto:robjsargent(at)gmail(dot)com>
>> > <mailto:robjsargent(at)gmail(dot)com <mailto:robjsargent(at)gmail(dot)com>>> wrote:I have a table called "pair":
>>
>> CREATE TABLE pair(
>> group INT NOT NULL,
>> element INT NOT NULL,
>> CONSTRAINT PRIMARY KEY (group, element)
>> );
>>
>> I must add entries to the table "event". This table event will have a code that will be generated using a sequence of that is a function of s(group,element).
>> CREATE TABLE event(
>> group INT NOT NULL,
>> element INT NOT NULL,
>> code INT NOT NULL,
>> CONSTRAINT PRIMARY KEY(code, element, group)
>> );
>>
> Unless event table is searched by code more than group, you probably want to maintain the key order from the pair table's primary key.
>
> OK. I will do that.
>
> If gaps are ok do you still near multiple sequences?
>
> I need to start each "code" value from 1 in each (group, element) pair. This is because we only have 99999999 codes for each pair. We do not want to waste numbers. If there is a gap is OK but no a gap of millions of numbers.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Lewis 2020-03-20 02:38:45 Re: Could postgres12 support millions of sequences? (like 10 million)
Previous Message pabloa98 2020-03-20 01:35:12 Re: Could postgres12 support millions of sequences? (like 10 million)