On Mon, Sep 5, 2011 at 5:47 PM, Rado Rado <rrrado...@gmail.com> wrote:

> I'm running simple prepared SELECT statement in loop ( about 3000 times ).
> It is something like "SELECT value FROM t WHERE t_id=? AND name=?".

,,,
> When I execute any SELECT query (using different table, like SELECT * FROM
> t2) which returns some row and I won't call reset() so it stays open, when
> I
> execute the loop described above after this, it is much faster (0.08 sec.).
>

Remember that the WHERE clause in the first query takes time to evaluate,
whereas the second query has no conditions and can therefore (at least in
principal) respond with the first result more quickly.

Whether or not that explains the whole difference, i cannot say (only
profiling could), but some of the gurus on the list can probably give you
some ballpark numbers on the effect the WHERE clause has.

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to