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

From: pabloa98 <pabloa98(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: Rob Sargent <robjsargent(at)gmail(dot)com>, "Peter J(dot) Holzer" <hjp-pgsql(at)hjp(dot)at>, "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-22 21:53:58
Message-ID: CAEjudX7mqE-opjcMp6OOpBtB9XCZLGZD61SnrRTX5K7LR0tQJg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2020-03-23 00:06:49 Re: Could postgres12 support millions of sequences? (like 10 million)
Previous Message Don Seiler 2020-03-22 21:48:57 Re: Mixed Locales and Upgrading