I made a mistake by going with option 1, and given the opportunity to return in time, I would have done it differently.
Your database will almost certainly not use the index to create bitwise queries in your bitmask. Therefore, if you want to find, say, everyone working on Tuesdays, each time you will do an index scan. As your tables grow large, it can ruin your performance. You can try to optimize around this by copying SELECT DISTINCT(bitmaskfield) advance, executing the bit mask logic in your own application and applying it to the corresponding WHERE bitmaskfield IN (...) , but this quickly becomes unreachable as you need to update your distinct -bitmask in every place where you change the values ββin the database.
Additional tables and joins may seem painful, but the bitmask will be worse. Believe me. Use your database as a database.
dkarp source share