If I have a table like this:
CREATE TABLE sizes ( name ENUM('small', 'medium', 'large') );
Is MySQL going to store those strings in every row, or internally will it use something smaller like integers to know which enum value to refer to?
I want to use an enum in a table but I’m worried if it’s as wasteful as storing a string in every row.
It converts them to integers on INSERT / UPDATE and back to strings on SELECT so the internal storage is as integers but you don’t get exposed to that.
You can retrieve the integer like
SELECT mycolumn + 0.See ENUMs in MySQL 5