On Fri, 20 May 2011 20:33:04 +0900, Hyoseok Kim
<toriwo...@gmail.com> wrote:

>Hi, I'm Hyoseok Kim from Korea.
>
>I develop a app on iphone. I use SQLite for about 120,000 data. In my code,
>sqlite3_step hold 0.5~1.0 sec.
>Please give me a hint to escape sqlite3_step method rapidly.
>
>Please help me.
>Thank you so much.
>
>
>My code is below...
>
>           if (sqlite3_prepare_v2(db, query_stmt, -1, &statement, NULL) ==
>SQLITE_OK) {
>
>            int rowCount = 10;
>            while (sqlite3_step(statement) != SQLITE_DONE) {
>                // Some code to retrieve values
>                // Looping...
>
>                // 0.5~1.0 sec hold after read last row data.
>            }
>         }

It all depends on the schema, the SELECT statement you use and the
exact working of the loop. With the information you gave it is
hard to tell what is happening.
If you for example SELECT all rows, but only use the first 10 and
step through all other rows without processing them, you force the
sqlite engine to finish the query. You could stop stepping after
the last row you want to process by leaving the while loop and
calling sqlite3_reset().

This papge might be of interest for you:
http://www.sqlite.org/cvstrac/wiki?p=ScrollingCursor

-- 
  (  Kees Nuyt
  )
c[_]
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to