Details
-
Task
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
None
-
None
Description
at the moment there is no good way to search in set columns. The only way is to use
FIND_IN_SET(xx, set-Col)
which is "ok" if you just have one set val to search. But it does not use the index.
If you want to search for more than one col, you must write
FIND_IN_SET(xx, set-Col) OR FIND_IN_SET(yy, set-Col)
The only "good" solution is, to query the set-structure
SET('xx','yy')
determine the bits and have a "unreadable query"
set-col = 27
It would be good to have an operator which uses the definition of the table, like it is done when the query is returned, so one could write sth like this
set-col=SET_COL('xx','yy')
where "SET_COL('xx','yy')" would return sth like 27 by looking up the value via the table defintion. Now indices could be used, and the query remains readable.