简体   繁体   English

MySQL 枚举性能比 INT 慢吗?

[英]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?有一个带有查找表的字段status enum('active', 'hidden', 'deleted')status tinyint(3)是否更好? 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 ?特别是,我想知道enum上的操作是否比int操作明显慢或一样快?

There is a related question on SO but: SO上一个相关的问题,但是:

  1. It does not discuss performance at all;它根本不讨论性能;
  2. There is very little explanation on why one approach is better than the other.关于为什么一种方法比另一种方法更好的解释很少。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM