Indices in one bit field will be mostly useless. A little scary selectivity, 0 or 1, and probably the optimizer will ignore it. 8 indexes on 8-bit fields will be 8 indexes that are not taken into account by the optimizer.
The index in the byte column is only slightly more selective, with 256 different values. But if you are looking for individual bit patterns, such as “3 on,” then there is no way to express this as an individual value for a search or as a range.
The conclusion is that no matter what you try, you will end up in the table anyway.
So better explain what your problem is, and not your solution, and perhaps we can think of something more effective.
source share