If the two values occur roughly equally often, then the query optimiser will usually ignore any index, so there is no point in having one, as it would only slow down updates. However, if one particular value predominates, then it could make sense to have an index.
My experience in Oracle (if applicable to MySQL) was that using a standard b-tree index on a field like that usually slowed the query down. Oracle has a "bitmap index" that handles those types of keys efficiently, but I'm not aware of a similar feature in MySQL.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.