Yes. If the OP's [normword] column contains proper nouns, he must normalize
to lower case in order to get accurate results from GLOB.
Or, if his lexicon contains proper nouns in upper case and normal nouns in
lower case, then he could always leave the case intact and use GLOB to get a
count of proper nouns versus normal nouns ;-)

... GLOB 'A*'
... GLOB 'a*'

Regards
Tim Romano




On Mon, Apr 26, 2010 at 8:47 AM, Igor Tandetnik <itandet...@mvps.org> wrote:

> Tim Romano wrote:
> > If the implementation of SQLite you are using overrides the LIKE operator
> > (as more than a few do), then SQLite will not make use of an index on the
> > column in question. Use the GLOB operator instead.
> >
> > For example, I have a lexicon containing 263,000 words:
> >
> > select count(*) from lexicon where spelling like 'a%'   // 552 ms on
> first
> > run and then 355ms on second and subsequent runs
> > select count(*) from lexicon where spelling glob 'a*'  // 110 ms on first
> > run and then ~10ms on second and subsequent runs
>
> Note that, by default, LIKE is case-insensitive while GLOB is
> case-sensitive. Thus, even if not overridden with a custom function, LIKE
> cannot be optimized unless the column is declared with NOCASE collation.
> Again, this article provides all the details:
> http://sqlite.org/optoverview.html#like_opt
> --
> Igor Tandetnik
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to