Yes, _step would generally take the most time, as that's where the actual work happens.

Yes, you would call _step once for every row produced by SELECT (as well as certain PRAGMAs), and only once for other statements that don't produce a resultset.

Igor Tandetnik

On 11/13/2013 4:42 PM, L. Wood wrote:
These are the main SQLite functions:

_open()
_prepare_v2()
_step()
_column()
_finalize()
_close()

Suppose I'm calling these once to execute a single SQL statement.

Can you give me a feel for which of these functions takes the longest to 
execute? There are two cases I'm interested in:


1.
"Read statements" like this: "SELECT * FROM SomeHugeTable;"

I guess that _step() will take most of the time, and that we will have to call 
it multiple times for each row in the table? Correct me if I'm wrong.


2.
"Write statements" like these:

"INSERT INTO SomeHugeTable (col1,col2) VALUES (val1,val2);"
or
"UPDATE SomeHugeTable SET col1='whatever' WHERE rowid=10566;"

Here I would also guess that _step() would take the longest? Also, am I correct 
in assuming that both of these statements would only need a single _step() call 
(since there are no results returned)?                                  



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

Reply via email to