Hello,
For some reason the following query is not using index (birthday column). Is there any way how to fix it or any other method how to select today's rows from date column? Date column caonains dates in this format: 1971-06-24
Thanks.
mysql> explain SELECT id, nickname FROM users_table WHERE substring(birthday,6) = substring(curdate(),6) limit 5;
+----+-------------+-------------+------+---------------+------+---------+------+-------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------------+------+---------------+------+---------+------+-------+-------------+
| 1 | SIMPLE | users_table | ALL | NULL | NULL | NULL | NULL | 16522 | Using where |
+----+-------------+-------------+------+---------------+------+---------+------+-------+-------------+