Easy question:
I have a datetime column in a table of 150,000 rows,
and I want to query records for a certain day AND use
the index on the column.. Anytime I do this:
SELECT * FROM tables where TO_DAYS(NOW()) = TO_DAYS(entry_time) ; <today's
records>
Or
SELECT * FROM tables where TO_DAYS(entry_time) = 730249;
<records for some other day, using from_days() function)>
The explain does not use the index on entry_time, and I don't want to add
another column just for day number..
Thanks in advance!
-Hank