3 ms·
An enumerated field will be represented most likely as an integer value in the row, so keep that in mind. Otherwise, you are going to use a foreign key lookup
by dillonmckay 7y ago
An enumerated field will be represented most likely as an integer value in the row, so keep that in mind.
Otherwise, you are going to use a foreign key lookup to get your type, which will also be an integer stored in that same row.
But, if you wanted to add a new animal type, and you used a lookup table, even if you have billion of rows, you are not messing with the table with a bunch of data. That may not be the case with an enum.
It sucks to ALTER a live table in production with billions of rows being actively INSERTed.