Alex Rivera | Logout

MySQL Enum performance advantage?

Asked 2009-04-19T22:52:05.420
64

Is there a performance advantage to using enum in situations where there are only 5-10 different possible values for a field? if not what is the advantage?

Edit
Report

1 Answer

13

In this article Using the ENUM data type to increase performance Fernando looks into performances of Enum type for queries.

The result is that while using ENUM might seem a little less elegant from a design point of view (if your ENUM value are changing sometimes), the performance gain is obvious for large datasets.

Well, it's quite obvious that while using ENUM might seem a little less elegant from a design point of view (what happens if I use Types in more than just one table? What if I want to add a type? I have to alter the table!), the performance benefits, if I'm going to be handling large quantities of data (and my tests have been with small amounts, but I don't have a server, just a very humble notebook) might be worthwhile.

See his article for details. Do you agree?

answered 2012-10-25T12:26:31.333

Your Answer