开发者

SQLite FTS3 inconsistent performance

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜