Re: Lookup tables - Mailing list pgsql-general

From David G. Johnston
Subject Re: Lookup tables
Date
Msg-id CAKFQuwZxDUwyxrcB8Br0XDTUuy_zPi_CNF+sQorGoM=z4Hwndg@mail.gmail.com
Whole thread Raw
In response to Re: Lookup tables  (Rich Shepard <rshepard@appl-ecosys.com>)
Responses Re: Lookup tables
List pgsql-general
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
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
little, if anything.

It’s the FK side where the cost savings are experienced.

David J. 

pgsql-general by date:

Previous
From: Ron Johnson
Date:
Subject: Re: Lookup tables
Next
From: Ron Johnson
Date:
Subject: Re: Lookup tables