Multiple and single indexes

后端 未结 4 909
忘了有多久
忘了有多久 2021-01-30 17:08

I\'m kinda ashamed of asking this since I\'ve been working with MySQL for years, but oh well.

I have a table with two fields, a and b. I will b

4条回答
  •  一向
    一向 (楼主)
    2021-01-30 18:06

    For the example you have index set #3 is optimal. Mysql will choose the single A and B indices for single column where clauses, and use the compound index for the A & B where clause.

提交回复
热议问题