MySQL: Which is faster — INSTR or LIKE?

Posted by Grekker on Stack Overflow See other posts from Stack Overflow or by Grekker
Published on 2010-03-16T01:38:42Z Indexed on 2010/03/16 1:39 UTC
Read the original article Hit count: 290

Filed under:
|
|

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, and why?

Or, is there some other method that tops either of these?

INSTR( columnname, 'mystring' ) > 0

vs

columnname LIKE '%mystring%'

© Stack Overflow or respective owner

Related posts about mysql

Related posts about php