RP McMurphy wrote:
> Is there a way we can make the w index work with both queries and not
> have to run external loops to flatten all the WHERE clauses?

<http://www.sqlite.org/lang_analyze.html>

sqlite> .timer on
sqlite> select count(*) from v where    z = 0 and
   ...>                         (       y between 1000000 and 1001000
   ...>                         or      y between 2000000 and 2001000
   ...>                         or      y between 3000000 and 3001000
   ...>                         or      y between 4000000 and 4001000);
1334
Run Time: real 1.100 user 1.092007 sys 0.000000
sqlite> analyze;
sqlite> select count(*) from v where    z = 0 and
   ...>                         (       y between 1000000 and 1001000
   ...>                         or      y between 2000000 and 2001000
   ...>                         or      y between 3000000 and 3001000
   ...>                         or      y between 4000000 and 4001000);
1334
Run Time: real 0.002 user 0.000000 sys 0.000000


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

Reply via email to