Inconsistent performance of SQLite FTS3

Table with ~ 100k rows.

SELECT word FROM entries WHERE word MATCH '"chicken *"';
17 results in 46ms
SELECT word FROM entries WHERE word MATCH '"chicken f*"';
2 results in 5793ms

      

Why such a huge fall?

+2


a source to share


1 answer


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



The wildcard in chicken f * should match all entries with words beginning with f that also contain chicken. This is understandably more complicated and slower.

+2


a source







All Articles