Jump to content

Select bitmask?


Azu

Recommended Posts

Hello.. how do I select based on bitmasks?

 

I'm looking for something like.. select * from table where 16 in bitmask(field)

 

Edit: and I need to make sure that it will be indexed right of course so that it won't be slow. I'm guessing that indexing this column just like I would any other should work? Or is there something special I have to do for it to work for bitmasks?

Link to comment
https://forums.phpfreaks.com/topic/74590-select-bitmask/
Share on other sites

Thanks that will work ^^

 

I don't understand why I can't index it though.. I want it to be fast..

 

 

Would it be faster just to make add like 40 tinyint(1) rows?

How would you design such an index? It's like trying to index the 3rd and 6th letter of a CHAR field.

 

40 rows is a bad idea... bitmasks are a bad idea.

Link to comment
https://forums.phpfreaks.com/topic/74590-select-bitmask/#findComment-378606
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.