Re: Using a single sequence for all tables - Mailing list pgsql-general

From Peter J. Holzer
Subject Re: Using a single sequence for all tables
Date
Msg-id YVQ4B8o7lDW1fi8K@hjp.at
Whole thread Raw
In response to Re: Using a single sequence for all tables  (Tobias Meyer <t9m@qad.com>)
List pgsql-general
On 2021-09-29 11:42:42 +0200, Tobias Meyer wrote:
>     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.
[...]
>
> * you will have to pay attention to rollover/overflow situations more quickly. 

I'd subsume this under "ids will grow faster".

But I would actually see that as an advantage:

* All your ids have the same type, so either 32 bit is enough for
  everything or you use 64 bit (do the latter if in doubt).
* You only have to monitor a single sequence to see if you are close to
  an overflow, not dozens of them.
* You will probably be more aware that this might be a problem.

        hp

--
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Attachment

pgsql-general by date:

Previous
From: Tobias Meyer
Date:
Subject: Re: Using a single sequence for all tables
Next
From: Laurenz Albe
Date:
Subject: Re: Using a single sequence for all tables