tags:

views:

277

answers:

2

How do databases (mySQL if a particular example is important) determine the size of the column needed to store an ENUM?

Is it something simple like a single byte for less than 256 enum options, etc.?

+7  A: 

MySQL Manual says "1 or 2 bytes, depending on the number of enumeration values". If the ENUM has less than 256 possible values, it uses 1 byte, otherwise 2.

See: 10.5. Data Type Storage Requirements

Chad Birch
thanks! I guess i need to stop referring to this nutshell book.
A: 

Your question is mostly a duplicate of Which database systems support an ENUM data type, which don’t? where you'll find answers for most DBMSs.

bortzmeyer