If your goal is to test if a string exists in a MySQL column (of type \'varchar\', \'text\', \'blob\', etc) which of the following is faster / more efficient / better to use
MySQL - INSTR vs LOCATE vs LIKE vs REGEXP
For me the INSTR and LOCATE performed the fastest:
# 5.074 sec
SELECT BENCHMARK(100000000,INSTR('foobar','foo'));
# 5.086 sec
SELECT BENCHMARK(100000000,LOCATE('foo','foobar'));
# 8.990 sec
SELECT BENCHMARK(100000000,'foobar' LIKE '%foo%');
# 14.433 sec
SELECT BENCHMARK(100000000,'foobar' REGEXP 'foo');
# 5.5.35-0ubuntu0.12.10.2
SELECT @@version;