From: Martijn Tonies
Date: October 4 2006 11:14am
Subject: Re: too many enum values?
List-Archive: http://lists.mysql.com/mysql/202311
Message-Id: <034001c6e7a6$51011290$cd02a8c0@martijnws>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
> how many is too many?
>
> i have a field with 21 possible values. each of the values are only 2 or 3
> letter strings, but that seems like a lot, would it be faster/more
efficient
> to put them in a separate table and just join?
What would you put in the separate table then? Just these 2-3 letter
strings and use the value as the PK?
You should ask yourself the following --
- do these values change depending on the customer? If so: table.
- can customers add possible values for this column? If so: table
- is there some kind of "description" for the possible values? If so: table
- is this an internally used value/code? If so: enum would be fine
- would values only be added during a database upgrade? If so: enum would
be fine
All in my opinion, of course.
Martijn Tonies
Database Workbench - development tool for MySQL, and more!
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com