On 21 Jun 2010, at 12:41am, P Kishor wrote:

> iirc, LIMIT 1 is applied *after* the WHERE clause is satisfied. In
> other words, the entire result set is returned, and then it is
> LIMITed. So, the behavior is correct.

That does agree with what Sam is reporting.  However, I am surprised at this 
fact.  I have been assuming for years that using LIMIT saves the SQL engine 
from having to list all the possible entries.  Having used a number of other 
SQL implementations over the years it didn't even occur to me to check to see 
how LIMIT was implemented in SQLite.  I'm sure I'm not the only person who uses 
LIMIT assuming it will reduce CPU and memory to a small limited amount.

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

Reply via email to