pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter J. Holzer <hjp-pgsql@hjp.at>
To: pgsql-general@lists.postgresql.org
Subject: Re: Using a single sequence for all tables
Date: Wed, 29 Sep 2021 11:55:19 +0200
Message-ID: <YVQ4B8o7lDW1fi8K@hjp.at> (raw)
In-Reply-To: <CAAEpUZmfAbEOmApLBHf6vMr_gguCX+Kc3aBhK81oPiOfzH+08A@mail.gmail.com>
References: <YVQxL6YWXxhQwcft@hjp.at>
	<CAAEpUZmfAbEOmApLBHf6vMr_gguCX+Kc3aBhK81oPiOfzH+08A@mail.gmail.com>

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!"

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (6+ messages)  latest in thread

Message-ID: <YVQ4B8o7lDW1fi8K@hjp.at>
Permalink:  ../YVQ4B8o7lDW1fi8K@hjp.at/
Also on:    postgresql.org/message-id/YVQ4B8o7lDW1fi8K@hjp.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: hjp-pgsql@hjp.at
  Subject: Re: Using a single sequence for all tables
  In-Reply-To: <YVQ4B8o7lDW1fi8K@hjp.at>
  References: <YVQxL6YWXxhQwcft@hjp.at> <CAAEpUZmfAbEOmApLBHf6vMr_gguCX+Kc3aBhK81oPiOfzH+08A@mail.gmail.com> <YVQ4B8o7lDW1fi8K@hjp.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox