Mysql Improve Search Performance with wildcards (%%)

后端 未结 6 763
青春惊慌失措
青春惊慌失措 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 11:00

    No, because MySQL will not be able to utilize the index when you have a leading wildcard. If you changed your LIKE to 'f%', then it would be able to use the index.

提交回复
热议问题