views:

49

answers:

2

In performance 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

+3  A: 

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.

Ian
+1  A: 

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.

Erik