On Fri, 2005-04-08 at 11:53 -0700, Maksim Yevmenkin wrote:
> CREATE INDEX data_by_a ON data (a);
> 
> > time sqlite3 db 'select n2 from data where a <= 18234721' > /dev/null
> 25.95u 0.71s 0:27.02 98.6%
> 

If you make the index look like this:

  CREATE INDEX data_by_a ON data(a, n2);

Then SQLite only has to look at the index to get the information
it needs.  It never has to consult the original table.  This will
make the query about twice as fast or maybe even a little faster.
-- 
D. Richard Hipp <[EMAIL PROTECTED]>

Reply via email to