Optimize mysql query to use index on a Bitwise where clause

后端 未结 3 1380
梦如初夏
梦如初夏 2021-02-10 10:52

I have a query which looks like:

select count(*) from m1
WHERE  (m1.`resource` & 1472 );

Although I have index on resource it doesn\'t use

3条回答
  •  故里飘歌
    2021-02-10 11:15

    On Sql server, it does use index on bitwise operation. I am trying to reproduce the performance on MySql but cannot.... MySql is a great idea but if they do not consider fundammental performance on bitwise operation for example, this is a big disappointment indeed!

提交回复
热议问题