I'd like to make this query the fastest possible, since similar ones areit's called pretty much every request for my app (person_id just changes)really often.
SELECT login_events.id
FROM login_events
WHERE (
DATE(created_at) >= DATE(CURRENT_DATE)
AND person_id = 1
)
LIMIT 1
It's running on a 157.7mb InnoDB table (says navicat), with ~2million rows and indexed on [created_at, person_id].
Using EXPLAIN I see it's using the index, but it says "Using where; Using index;". What can I do to make this the fastest possible? Would switching to MyISAM gain me anything?