Mysql Improve Search Performance with wildcards (%%)

后端 未结 6 775
青春惊慌失措
青春惊慌失措 2020-11-30 10:24

Below is a query I use for searching a person by email

  SELECT *
    FROM phppos_customers
    JOIN phppos_people ON phppos_customers.person_id = phppos_peo         


        
6条回答
  •  不知归路
    2020-11-30 10:46

    No, Mysql will not use the index because LIKE argument (%f%) starts with the wildcard character %. If it starts with a constant, index will be used.

    More info: 7.5.3. How MySQL Uses Indexes

提交回复
热议问题