To me, since the DB is there to serve the app (which is there to serve the user), the lookup/enum decision mostly depends on whether the list is defined before build time (> enum) or after (> lookup).
US states are probably a solid "before", so you get the added value of easily materializing a validator in the app code.
Children IDs sound a bit more dynamic.
What is better: a lookup table or an enum type?
21–23 of 23 posts
Re: What is better: a lookup table or an enum type?
#22Not super familiar with the internals of postgres, but what sort of performance would something like this have?
SELECT person_id
FROM person_l
WHERE state_id = (SELECT id FROM state_l WHERE name = 'Burgenland');Re: What is better: a lookup table or an enum type?
#23Whatever needs the least number of joins is the best.