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.
精彩评论