Currently I am designing a mysql table structure that will hold a couple of million rows. I want to search in it on datetime field by date year and so on but the date will be entered by user so it may not be full date all the time. The field is indexed. Will it be fast enough to use wildcard on the datetime field. Like so
SELECT `id`, `moment`, `object_uid`, `content` FROM `events` WHERE moment like '2015%';
Will it use the index?
There is an option to determine whether or not the user have entered year or month and year and so on but I prefer to let MySQL do the job.