In my database, there is table called Profile which has a DATETIME field called birthday.
I want to query all the records that has birthday between 05-24 and 06-07 (mm-dd) regardless of what year it is and I used the following query:
DATE_FORMAT(`Profile`.`birthday`, "%m-%d") >= '05-24'
AND DATE_FORMAT(`Profile`.`birthday`, "%m-%d") < '06-07'
The problem is by doing this way, the index on birthday column has no use, the query is too slow and I want to improve the speed of my query
Please show me if there is any workaround that could still do the job and improve the query performance at the same time