N
N
noneim2017-02-21 14:03:58
MySQL
noneim, 2017-02-21 14:03:58

Will bitmap index work fast?

Suppose there is an unsigned int field in the table, in which 32 bits are encrypted, each of which means yes / no (a set of some conditions that can occur simultaneously).
Accordingly, to select a set of values ​​with certain filters, a query like this is executed:
SELECT * FROM TABLE WHERE (column & 0b0101111) = 0b0101111; // If full match needed
SELECT * FROM TABLE WHERE (column & 0b0101111) <> 0; // If at least one match is enough
Mysql only has a BTREE index, it is not used in this query. There is a BITMAP index in postgresql, and accordingly the question is - is the BITMAP index suitable for this kind of queries, will it be effective, and suddenly, does anyone know if such an index will be supported in mysql / mariadb in the future?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry MiksIr, 2017-02-21
@noneim

No, a bitmap index is different, it has nothing to do with bitmap operations
https://wiki.postgresql.org/wiki/Bitmap_Indexes
If you have a limited number of such conditions, you can build indexes by expression (for example, an index by expression column & 0b0101111) .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question