In per开发者_如何学运维formance terms, what will be faster, use a BIT(1) NULL (null = unknown, 0 = male, 1 = female) or ENUM('unknown', 'male', 'female') NOT NULL DEFAULT 'unknown' in MySQL MyISAM?
Or this is considered micro-optimization?
[EDIT]
I think I'm going to use ENUM('male', 'female') DEFAULT NULL
Yes, this is microoptimization. Performance will be dominated by other things, and anyway nullable fields take more space (for a null flag) so use the meaningful enumeration.
I consider this micro-optimization.
I would go for the ENUM option, because the meaning of all values is completely clear without reading documentation. The bit option is a bit vague.
Regarding performance, I seem to remember NULL is usually bad, but can't find references right now.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论