With fts4aux, the term table would be a perfect candidate to implement an
autocomplete function in our application.
 
However a query 
  SELECT term FROM ft_terms WHERE term LIKE 'descr%'
is quite slow as no 'index' is used (indexes are not possible on virtual
tables).
 
With checkin  <http://www.sqlite.org/src/info/386701de>
http://www.sqlite.org/src/info/386701de Dan added an optimization for
queries with '=', '<' and '>' in fts4aux so I rewrote my query to
  SELECT term FROM ft_terms WHERE term BETWEEN 'descr' AND 'descr' ||
CAST(x'FF' AS CHAR)
and indeed: blazingly fast.
 
Is there any risk with this (rather ugly) workaround?
 
Is there any chance an optimization gets added for the simple LIKE 'abcd%'
filter? I think it will be a very common usage case for the fts4aux virtual
table
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to