如果涉及通配符,是否仍可以像操作员一样加快mysql的运行速度?例如.就像%test%"
is there anyway to speed up mysql like operator performance if wild card is involved? eg. like '%test%'
推荐答案如果查询看起来像foo LIKE 'abc%'或foo LIKE 'abc%def%',MySQL可以使用索引.它可以将索引用于第一个通配符之前的任何部分或字符串.如果需要在字符串中的任意位置匹配单词,则可能需要考虑使用FULLTEXT索引.
MySQL can use an index if your query looks like foo LIKE 'abc%' or foo LIKE 'abc%def%'. It can use the index for any portion or the string before the first wildcard. If you need to match a word anywhere within a string, you might want to consider using FULLTEXT indexes instead.
有关索引的更多详细信息: dev.mysql /doc/refman/5.1/en/mysql-indexes.html
More detail on indexes: dev.mysql/doc/refman/5.1/en/mysql-indexes.html
全文搜索: dev.mysql. com/doc/refman/5.0/en/fulltext-search.html
更多推荐
mysql像性能提升
发布评论