Mysql 全文索引ngram测试

测试了一下全文索引(ngram), 全文索引一个问题, 当每条数据都包含一个词时,如:“活动”。 这时,搜索“活动”, 查询速度偏慢。

20万数据:0.89秒钟

100万数据:4.5秒钟

没有不走索引的like快。

 

如果不考虑分词,推荐使用like。

参考文档:

InnoDB全文索引基础 https://blog.51cto.com/lee90/1959856

information_schema系列十 https://www.cnblogs.com/shengdimaya/p/6916554.html

MySQL中InnoDB全文检索 https://www.cnblogs.com/olinux/p/5169282.html

N-GRAM解决MYSQL单表千万级数据检索 https://www.zengjianfeng.com/2017/06/150.html

https://dev.mysql.com/doc/refman/5.7/en/fulltext-search-ngram.html

https://dev.mysql.com/doc/refman/5.7/en/fulltext-search.html

你可能感兴趣的:(数据库)