Alberto Simoes wrote: > On Fri, Jun 26, 2009 at 3:00 PM, Igor Tandetnik<itandet...@mvps.org> > wrote: >> Alberto Simoes wrote: >>> SELECT DISTINCT(word) FROM dict WHERE word = "ar" OR word = "ca" OR >>> word LIKE "_car" OR word LIKE "c_r" OR word = "cr" OR word LIKE >>> "_ar" OR word LIKE "ca_r" OR word LIKE "c_ar" OR word LIKE "ca_" OR >>> word LIKE "car_"; >> >> I'd try writing a custom function that figures out whether two words >> are "close enough" (most of the time, you should be able to declare a >> negative by looking at just two first characters), then do >> >> select word from dict where closeEnough(word, 'car'); > > Hmms, need to check how to do that. But that would mean call the > function to all words in the database (110K atm).
Well, your current statement evaluates a complicated condition against every word in the database. I don't quite see how you can avoid checking every word - you can only try and make the check itself faster. Igor Tandetnik _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users