The following question is framed with a particular lean towards MySQL and PostgreSQL, but I'd also be interested in answers regarding other database systems.
I'm designing a database and the SET
column type appears to fit the bill in a few cases. One such example could be expressed as a boolean column for each day of the week, and I'm thinking of instead using MySQL's SET
, SET('Sun','Mon','Tue','Wed','Thu','Fri','Sat')
.
Is an index on such a SET
column useful? Would it speed up searches for rows matching individual days of the week? Particular combinations of days of the week? Or would it only speed up searches for full exact binary values of the field (such as 0101010
for Mon/Wed/Fri)?