Re:Vertically Scaling PostgreSQL
by joeyrobert on Thursday March 21, 2019 @11:06AM
(#19453160)
Normalizing has similar size benefits. For our use case (big aggregate reporting tables), incoming external data is not normalized, meaning we'd have to have another process iterate over it with foreign table in memory and map it to the foreign key. Enum's can be transparently ingested without this normalization requirement, while taking equivalent space. There's also now one level of indirection between the column and its value. Both are fine.
Postgres keeps ENUM types in memory at all times. A join table is probably a slower option, all other things being equal. There are cases where it's worthwhile (dynamically expanding the values that would be in that enum, for example), but it's a tradeoff.
Can you give an example?
It sounds like normalising the schema would have similar (perhaps more) benefits.