Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tfKhG-001Ufh-9L for pgsql-general@arkaria.postgresql.org; Tue, 04 Feb 2025 15:18:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tfKhF-004az4-6F for pgsql-general@arkaria.postgresql.org; Tue, 04 Feb 2025 15:18:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tfKhE-004ayv-SU for pgsql-general@lists.postgresql.org; Tue, 04 Feb 2025 15:18:40 +0000 Received: from mail-ot1-x32c.google.com ([2607:f8b0:4864:20::32c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tfKhC-003Fjf-1D for pgsql-general@postgresql.org; Tue, 04 Feb 2025 15:18:40 +0000 Received: by mail-ot1-x32c.google.com with SMTP id 46e09a7af769-71e3f291ad6so3452831a34.0 for ; Tue, 04 Feb 2025 07:18:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738682317; x=1739287117; darn=postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=/vXfjwC7IIywwRRnF/sBJpRcmihDHPDr5Tbd2PkEu9A=; b=OxFiZJ1//IcYSW2Gzm0s1qlkQNZl2yutHpr6lSMkIq6jrNku7KvdYP26+S4LvqghCI IBk2u34z4sCsKGUExcqhhcGBDtLkspT8Ytx2ZcrgMwTgcQd03xCintLvcWjlYbbSHOET G3jt1NnOiTizkiwYSmniTaHjzqQ34dL2B4yiWnVRsj2/DsrbKDq578I52URplyl4OjLi ItLls1cUTtlcJNQN4ELdUjnDkvDFhGVITWkDAwKpYV5g5Fj1KNUt3vy2Ny5HA2+jlFCM iAywT86e1QfsBz/FtCu6EcM8wrEi6MFEoKmuti8dQ+F+nCt/DsF8fS2kujHeCc/2D5Rg irLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738682317; x=1739287117; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/vXfjwC7IIywwRRnF/sBJpRcmihDHPDr5Tbd2PkEu9A=; b=UKRb6Tsnb8Hf6Wz8r0PYIyRv7vyU2WstGHN+sCvMYNwo3NvnWeEsZYa32Jmf4FDfpC 6enh55rCificc4vqA5vLErVQ3O4eTyMsls74+dMhMc04o6h6zr86QnfDiY4QvN2/6yrg 9X0uMVdaMyWS3J6yIyRL32VqFv4rXgmcSlLAhSGL9gBIHVFOtaqQ7mPcZhsx3Wbd7lRW u3OuAjZoe42APRSptOrXHa2vYRanz6/95/kQ6ALWISM67PFWYyGDn9h6Wpjh0f45vdis uIpnaRiCtfXLfPFwsEKFUv2JmnODh18/KzQ7IP+iEBZIhc+caLUxzT3FFPv29OZ1mme4 SC5A== X-Gm-Message-State: AOJu0YxjWrXDcy8wIk70ROl5cyrwpbMTDsegy4h8c7g1o+0Qvs8jWcAe DiD+fKxR8OaU+FC0mnzo2eTtp5S8E0m8fJ2f1EyJq3Dr0v+OBGTWAoU6Qis/OfFIEsB92Po/QoF oLLuIDd2Nv/ir88Ul129Ljo1bO/A42A== X-Gm-Gg: ASbGncumovr5MRWibNULH1r5UXX4ieW+cgZpTv8nVc1UYZutjxlNh0KYXXPJRryWVKU sGmtXO9iKKl+1IriSpTFnQoNKXOJuibBH7SkQliKyBok/La8M55nNPPkTFdYpJR4XuwfxGgU= X-Google-Smtp-Source: AGHT+IGjAxE7uqz70UN/Gmw+Uz7rrOgtwhfNjfodGVrLz7KFOdvxTkqYBReQVTK/fECQGWxCK6wk2EXQIQ9JjpfKGJo= X-Received: by 2002:a05:6830:dca:b0:717:d48c:593 with SMTP id 46e09a7af769-72656776932mr20584112a34.10.1738682317038; Tue, 04 Feb 2025 07:18:37 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a05:6802:a0c:b0:577:9519:f64a with HTTP; Tue, 4 Feb 2025 07:18:35 -0800 (PST) In-Reply-To: References: <4e7a338-c7d3-e944-20bd-a6e346e175c7@appl-ecosys.com> From: "David G. Johnston" Date: Tue, 4 Feb 2025 08:18:35 -0700 X-Gm-Features: AWEUYZl98KfxThmtj8DOl1LGkISxFx0s0eJ54sBag4PjlEQhsVLL0J5hH4AM64w Message-ID: Subject: Re: Lookup tables To: Rich Shepard Cc: pgsql-general Content-Type: multipart/alternative; boundary="000000000000e269e3062d52859d" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000e269e3062d52859d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tuesday, February 4, 2025, Rich Shepard wrote= : > On Tue, 4 Feb 2025, David G. Johnston wrote: > > The point of a lookup table is to provide a unique list of authoritative >> values for some purpose. Kinda like an enum. But having the label serve = as >> the unique value is reasonable - we only add surrogates for optimization= . >> > > David, > > The industrytypes table has 26 rows, the statustypes table has 8 rows. Yo= ur > explanation suggests that for this database adding a PK to each table add= s > little, if anything. > It=E2=80=99s the FK side where the cost savings are experienced. David J. --000000000000e269e3062d52859d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tuesday, February 4, 2025, Rich Shepard <rshepard@appl-ecosys.com> wrote:
On Tue, 4 Feb 2025, David G. Johnston wrote:

The point of a lookup table is to provide a unique list of authoritative values for some purpose. Kinda like an enum. But having the label serve as<= br> the unique value is reasonable - we only add surrogates for optimization.

David,

The industrytypes table has 26 rows, the statustypes table has 8 rows. Your=
explanation suggests that for this database adding a PK to each table adds<= br> little, if anything.

It=E2=80=99s the FK side where the cost sa= vings are experienced.

David J.=C2=A0
--000000000000e269e3062d52859d--