On 25 Apr 2010, at 9:39pm, Alberto Simões wrote:

> One idea is to add a column named 'letter' and SELECT COUNT(letter)
> from dictionary WHERE letter = 'a'.

That will be the simplest way to make a fast lookup, though it will slow down 
your INSERT function.  You could speed it up a tiny bit more by making the 
search field an INTEGER field, and storing, for example, 65 in there for 'a', 
66 for 'b', etc..

Two ways to do it: either put the right letter in the column when you create 
the record, or leave the column at a dummy default value when you create the 
record and have an 'update index' which updates all records which have the 
dummy default value.  Which one you choose depends on whether your INSERT 
function has to run faster than it does naturally.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to