On 2/2/07, A. Pagaltzis <[EMAIL PROTECTED]> wrote:
5-10% in his tests, as he wrote a few mails up the thread. Significant? No. Worthwhile? Apparently so, for his application.
I saw that as well, but based on this:
> is there a more formal mechanism for getting this value without having
do
> to do a separate "select" query?
I got the impression he was executing a separate select statement to return the rowid into his C code and then passing that value back to the third insert using the C API to bind that rowid to the final insert. I suspect the reduction from executing three statements (insert, select, insert) down to only two (insert insert) would probably provide about the same performance increase as the 5% to 10% speedup he saw by replacing the separate select with the VDBE stack lookup hack. He also never said which API functions he was using to execute the inserts. I thought he may have been using the sqlite3_exec function which includes the overhead of compiling the SQL code for each execution. In that case, I suspect that changing to the prepared statements should provide more benefit than the VDBE stack hack by eliminating this overhead. Dennis Cote