Re: Using a single sequence for all tables

From: Tobias Meyer <t9m(at)qad(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Using a single sequence for all tables
Date: 2021-09-29 09:42:42
Message-ID: CAAEpUZmfAbEOmApLBHf6vMr_gguCX+Kc3aBhK81oPiOfzH+08A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
>
> Possible drawbacks:
>
> * The ids will grow faster, and they will be large even on small
> tables. It may be a bit irritating if you have a table with just 5
> rows and the ids are 5, 6, 7, 12654, 345953.
> * Bottleneck? Using a single sequence was said to be a performance
> bottleneck in Oracle. I didn't notice a performance difference then
> and I doubt it would be one in PostgreSQL, but if in doubt, measure!
> * Doesn't work with IDENTIY - those columns always use implicit
> sequences.
> * currval() is pretty useless with a global sequence. But I basically
> never use that anyway.
>
> * you will have to pay attention to rollover/overflow situations more
quickly.

Just my 2 cent.
Tobias

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter J. Holzer 2021-09-29 09:55:19 Re: Using a single sequence for all tables
Previous Message Peter J. Holzer 2021-09-29 09:26:07 Using a single sequence for all tables