JP19
JP19

Reputation:

Is MySQL enum performance slower than INT?

Is it better to have a field status enum('active', 'hidden', 'deleted') OR status tinyint(3) with a lookup table? Assume that status can take only one value at a time.

In particular, I am interested in knowing if operations on enum are significantly slower than or as fast as operations on int?

There is a related question on SO but:

  1. It does not discuss performance at all;
  2. There is very little explanation on why one approach is better than the other.

Upvotes: 18

Views: 8738

Answers (1)

Sarfraz
Sarfraz

Reputation: 382696

This is already discussed on popular http://www.mysqlperformanceblog.com, check out this post:

Upvotes: 25

Related Questions