I’ve got query:
SELECT *
FROM customer
WHERE tracker_id = :id
AND is_deleted = 0
AND (email LIKE LOWER(:text) OR phone LIKE :text)
LIMIT :startingPosition, 11
but sometimes it takes too long to execute.
I have two indexes
- tracker_id and email
- tracker_id and phone
but when making query based on the email it takes too long. Will the index take effect when there is LOWER function used? How could I improve this query