开发者

MySQL MATCH AGAINST vs LIKE

I am building a tool similar to Google Suggest. Queries pop up as someone is typing. The results are selected from a MySQL database, and the only results matched are the ones beginning with what the user has typed in.

How do I op开发者_运维知识库timize my database, tables, and MySQL queries (which are done with PHP) for the fastest performance? I know the two likely players are MATCH AGAINST and LIKE. Thanks!


MySQL's LIKE operator is fairly performant given that you are using it on an indexed column and that the string you are matching against does not begin with the wildcard character.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜