Problems in enum data type mysql

MySQL ENUM data type looks like a Hot SPOT among all developers n database designers. We all know about ENUM data type, but do we really know disadvantages or lets say problems of using ENUM data type while designing tables.

I was wondering what could be the reason that most of geeks don't want to use this data type, I just googled out some info about it and came across some very serious issues, so sharing on my blog.

1. Changing the member list of ENUM columns is very expensive.

    If your table has more than millions records and you are trying to change any thing in the column which has data type ENUM, then mysql rebuild complete table and look in to every row in that table. This may take lots of time may be hours and thus downtime.  So lets create equation

Server Downtime = MySQL table with ENUM data type + millions of records. Lol.

2. ENUM has limited portability with other databases.
    ENUM is not a standard SQL and lots of other databases doesn't have native support for ENUM.

Well there are lots of more issues with ENUM data type, I would like to share some links which may help you to take decision while using ENUM in your database. Check these links for sure , great information shared on it.

Link 1
Link 2


Post a Comment

Share this post with your friends