Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mVWJB-0006AO-G0 for pgsql-general@arkaria.postgresql.org; Wed, 29 Sep 2021 09:55:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mVWJA-0003h8-Ej for pgsql-general@arkaria.postgresql.org; Wed, 29 Sep 2021 09:55:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mVWJA-0003gz-63 for pgsql-general@lists.postgresql.org; Wed, 29 Sep 2021 09:55:24 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mVWJ6-0000tW-Ns for pgsql-general@lists.postgresql.org; Wed, 29 Sep 2021 09:55:23 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id 949F85680; Wed, 29 Sep 2021 11:55:19 +0200 (CEST) Date: Wed, 29 Sep 2021 11:55:19 +0200 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: Using a single sequence for all tables Message-ID: Mail-Followup-To: pgsql-general@lists.postgresql.org References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="sHEiW5Xtg4fiLfKb" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --sHEiW5Xtg4fiLfKb Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2021-09-29 11:42:42 +0200, Tobias Meyer wrote: > Possible drawbacks: >=20 > =A0* The ids will grow faster, and they will be large even on small > =A0 =A0tables. It may be a bit irritating if you have a table with ju= st 5 > =A0 =A0rows and the ids are 5, 6, 7, 12654, 345953. [...] >=20 > * you will have to pay attention to rollover/overflow situations more qui= ckly.=A0 I'd subsume this under "ids will grow faster".=20 But I would actually see that as an advantage:=20 * 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 --=20 _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | hjp@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" --sHEiW5Xtg4fiLfKb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmFUOAIACgkQ8g5IURL+ KF2oow//SVRSgOietih1jqmyHenQ5fb49F/GFH/2cMgR1cMvhtm8q8noRTKNxPXD dBI5qa8lzVBngjS29wBK6lqMP3h9v4lbkOqBD+Jw6L434b4zDife6KB0/6AHWXsn WgsYqheblanPJF/lXogjp7bntQb4v+xIk45wji5JUscQ7/9VETj1lQ5Hz9bOFyep iev0xY5QQ9t1/SC81ew6j0i4yBzYBi22pPtPnxXF62c9ZR1WSZpX7tYxItfMMRUI kt8bA7cfrD7KZcimYD62qM0h1ZWP5GuXYDF//Z526vt5J0AUHfwWR0q9Nz02/ncl v8hJeHzyGA39edWqFfi2p1Bh3y9Nedz34u3ltMEAuDr2kveJExu2HfW1itjl2+n+ EJ/6vqS49o3doJNDyMx2EgELpF0m9oDtE1NJhNScr5vHPtdZfTDV7XZxQRrttxUR K/SvdPtxFVPHaCwJUaxVZabZs/xaEd12lc+zJc29k/YHTs0toHXxvP5ZUiauSNRB pg96N0rqluW49PhMYo0GO69KjA6nW+YMIgos24DxbwM73xlTdU2zR/JLMCaN17gW F55SFDz9G09bM+SpnmpU5Is/0vUF+jUlHkp7hXFqoeI3yWkS9bYxOnRYjUV758Gu O6kDWhKP8p7biH0q9I+DDjiG15emvQ0sNRW2a7Awwa0RLLbdl+w= =7IrF -----END PGP SIGNATURE----- --sHEiW5Xtg4fiLfKb--