Re: Could postgres12 support millions of sequences? (like 10 million) - Mailing list pgsql-general

From pabloa98
Subject Re: Could postgres12 support millions of sequences? (like 10 million)
Date
Msg-id CAEjudX7mqE-opjcMp6OOpBtB9XCZLGZD61SnrRTX5K7LR0tQJg@mail.gmail.com
Whole thread Raw
In response to Re: Could postgres12 support millions of sequences? (like 10 million)  (Adrian Klaver <adrian.klaver@aklaver.com>)
Responses Re: Could postgres12 support millions of sequences? (like 10 million)
Re: Could postgres12 support millions of sequences? (like 10 million)
List pgsql-general

So the question may actually be:

How do we improve our locking code, so we don't have to spawn millions
of sequences?

What is the locking method you are using?

I am not using locking with the million sequence solution. I do not want something that locks because the problems described below

I prefer the solution generates a gap (skip a couple of numbers) and not using locks.



> The lock part is because we solved a similar problem with a counter by
> row locking the counter and increasing it in another part of the
> database. The result is that all the queries using that table are queued
> by pair (group, element) that is not that bad because we are not
> inserting thousands of rows by second. Still is killing cluster
> performance (but performance is still OK from the business point of
> view). The problem using locks is that they are too sensitive to
> developer errors and bugs. Sometimes connected clients aborts and the
> connection is returned to the pool with the lock active until the
> connection is closed or someone unlocks the row. I would prefer to have
> something more resilient to developers/programming errors, if possible.
>

Now I read this paragraph, I realize I was not clear enough.
I am saying we do not want to use locks because of all the problems described.
 

pgsql-general by date:

Previous
From: Don Seiler
Date:
Subject: Re: Mixed Locales and Upgrading
Next
From: Adrian Klaver
Date:
Subject: Re: Could postgres12 support millions of sequences? (like 10 million)