开发者

SQLite FTS3 inconsistent performance

开发者 https://www.devze.com 2022-12-28 08:21 出处:网络
A table with ~100k rows. SELECT word FROM entries WHERE word MATCH \'\"c开发者_如何学Pythonhicken *\"\';

A table with ~100k rows.

SELECT word FROM entries WHERE word MATCH '"c开发者_如何学Pythonhicken *"';
17 results in 46ms
SELECT word FROM entries WHERE word MATCH '"chicken f*"';
2 results in 5793ms

Why such a huge drop?


The wildcard in "chicken *" can effectively be ignored as it matches any token at all. The search is a simple lookup in the reverse index.

The wildcard in "chicken f*" needs to find all entries with words beginning with f, that also contain the word chicken. It is understandably more complicated and slower.

0

精彩评论

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