Performance of LIKE queries on multmillion row tables, MySQL

前端 未结 4 1673
感情败类
感情败类 2020-12-14 08:27

From anybody with real experience, how do LIKE queries perform in MySQL on multi-million row tables, in terms of speed and efficiency, if the field has a plain INDEX?

<
4条回答
  •  孤街浪徒
    2020-12-14 08:54

    LIKE will do a full table scan if you have a % at the start of the pattern.

    You can use FULLTEXT in Boolean (rather than natural language) mode to avoid the 50% rule.

    Boolean full-text searches have these characteristics:

    They do not use the 50% threshold.

    http://dev.mysql.com/doc/refman/5.0/en/fulltext-boolean.html

提交回复
热议问题