I was trying to optimize my MySQL queries, but found out that i'm actually doing this wrong. I've changed my query from using
SELECT * FROM test WHERE tst_title LIKE '1%'
To:
SELECT * FROM `test` WHERE MATCH(tst_title) AGAINST("+1*" IN BOOLEAN MODE)
And the runtime, for the FULLTEXT, was terrible.. See them below:
USING LIKE:
Showing rows 0 - 24 (1960 total, Query took 0.0004 sec)
USING FULLTEXT:
Showing rows 0 - 24 (1960 total, Query took 0.0033 sec)
I've read many tutorials wherein they explained, on why you should use FULLTEXT (since this actually searches by indexes). But how would this be a slower way to retrieve data, then the LIKE statement (since the LIKE statement has to go through every single record in order to return their validity)?
I literally can't figure out on why this is happening.. Help on optimization would be appericiated a lot!