On 24 Aug 2009, at 9:13am, nick huang wrote: > This is just the usual case when all query results are retrieved and > then sorted. What I am insterested in is if there is any method to > get the sorted rows by "step" as I am working on mobile phone system > where time-consumed operation would probably reset the system.
If you want to make sure that the _prepare and each _step execute quickly, make sure that you have an index on your files which is ideal for your SELECT command. Take a look at the WHERE and ORDER BY clauses of your SELECT command and CREATE an index which would be ideal for executing that command. This will allow SQLite to do the least amount of work when you're retrieving records. If you do this, then none of the library functions should take much time. SQLite is very efficient internally. Please do not worry about the time SQLite takes until you have tried a little sample of your own and seen that it really is a problem. > If sqlite's prepare cannot do better than "execute" in this aspect, > then what is meaning to use prepare/step? The document says sqlite > is especially suitable for embedded system and that is why I wonder > if sqlite has some revolutionary way to solve this problem. _execute must do the _prepare and all the _step commands at once, and reserve enough memory to keep all the results in at once. Breaking it down into _prepare and _step will be faster. Simon. _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

