Woody Wu wrote: > The following query statement executed very slow, it took 15 secs on my ARM > device, > > 1. select max(time) from mytable where time < 99999999 and id1 = k1 and id2 = > n. > > However, if I replace k1with another value that can be found in the table and > keep everything unchanged, like below, > > 2. select max(time) from mytable where where time < 999999999 and id1 = k2 > and id2 = n. > > This query run very well, it only took less than 1 second on the same system. > > Could anyone explain this to me?
The database can help with the explanation. What is the output of EXPLAIN QUERY PLAN for both queries? Regards, Clemens _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users