Re: [sqlite] sqlite3_step() vs. get_tables() - CPU-Usage

2006-08-15 Thread John Stanton

A. Klitzing wrote:

Hello,

I need some information about the sqlite3_step() function.
How much CPU-usage does it need in comparison with sqlite3_get_tables()?

I have to implement functions like next(), prev(), last(), first(), 
relative(int) and absolute(int).


#1 Way - sqlite3_step()
I can only step forward with sqlite3_step() and use sqlite3_reset() to get 
first() and iterate through the result to the position for relative() and so on.

#2 Way - sqlite3_get_tables()
I can use get_tables() instead and so I can set my cursor without problems to 
every relative position but I loose nice features that I have with sqlite3_stmt.


So the question is - needs sqlite3_step() a few performance so it is "ok" that I will 
iterate "dirty" through the result everytime?

Regards,
André Klitzing

-
To unsubscribe, send email to [EMAIL PROTECTED]
-

Sqlite3_step is how sqlite3_get_tables functions.  If you use step 
directly you will get more eficient processing, but if you intend to 
move all your selected rows into memory before processing them, then 
get_table is appropriate.  Just be wary when you use get_table that you 
could be consuming a large chunk of memory and choking your application 
unless you control it with a LIMIT or similar mechanism.


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] sqlite3_step() vs. get_tables() - CPU-Usage

2006-08-15 Thread A. Klitzing
Hello,

I need some information about the sqlite3_step() function.
How much CPU-usage does it need in comparison with sqlite3_get_tables()?

I have to implement functions like next(), prev(), last(), first(), 
relative(int) and absolute(int).


#1 Way - sqlite3_step()
I can only step forward with sqlite3_step() and use sqlite3_reset() to get 
first() and iterate through the result to the position for relative() and so on.

#2 Way - sqlite3_get_tables()
I can use get_tables() instead and so I can set my cursor without problems to 
every relative position but I loose nice features that I have with sqlite3_stmt.


So the question is - needs sqlite3_step() a few performance so it is "ok" that 
I will iterate "dirty" through the result everytime?

Regards,
André Klitzing

-
To unsubscribe, send email to [EMAIL PROTECTED]
-