You can use fastbit bitmap index, from mysql, using fastbit UDF. Check this link https://github.com/greenlion/FastBit_UDF
About these UDF Functions and FastBit
FastBit is a data store which implements WAH (word aligned hybrid) bitmap indexes. These UDF create, modify and query FastBit tables. The UDF treats a single directory on the filesystem as one FastBit table. Inside of the FastBit table/directory are directories representing partitions. The partitions are created automatically when data is loaded.
All functions take as the first argument the table path/directory
FastBit WAH bitmap indexes are optimal for multi-dimensional range scans, unlike b-tree indexes which are optimal only for one-dimensional queries. This means that FastBit can very efficiently handle queries that MySQL can not, like select c1 from table where c2 between 1 and 20 or c3 between 1 and 90 or c4 in (1,2,3). MySQL can not answer that query using a b-tree index and will resort to a full table scan.
All columns of a fastbit table are automatically bitmapped indexed.
The UDFs functions provided, are:
fb_helper, fb_inlist, fb_create, fb_load, fb_query, fb_debug,
fb_unlink, fb_delete, fb_insert, fb_insert2, fb_resort
There are also several limitations when querying a table (using fb_query functionality), see the READ.ME link for details.