> > SELECT count(*) FROM (SELECT a,n1 FROM data WHERE a <= 18234721 GROUP BY a);
> >
> > > time sqlite3 db < test.sql
> > 300000
> > 1024
> > 1417
> > 13.14u 1.06s 0:14.40 98.6%
> 
> Have you tried doing the query like this:
> 
>   SELECT count(*) FROM (SELECT a,nl FROM data WHERE a-18234721<=0 GROUP
> BY a);

i just tried. i think this effectively disables the index on column
"a" and on 9+ million records data set it took

> time sqlite3 db  < test.sql
300000
1024
1417
61.16u 40.69s 2:05.01 81.4%

thanks,
max

Reply via email to