开发者

MySql underscore wildcard optimization

Hey, I'm trying to optimize a SELECT char statement in mysql.

I am fully aware that using a LIKE '%text%' will NOT be optimizable, but can the underscore wildcard be used in any sort of optimization?

For instance I want something such as:

SELECT * FROM tbl WHERE col LIKE '_a_b_'

Is there a way to optimize this sort of query if I never u开发者_开发知识库se the % wildcard?


No. The only thing you can do in this case - is to create another field, that contains the same data without first letter and find WHERE col_cut LIKE 'a_b_'. And maintain it with triggers.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜