Re: [sqlite] UPDATE query: why is that code sooo slow?

2005-01-22 Thread D. Richard Hipp
On Sat, 2005-01-22 at 11:50 -0500, Luc Vandal wrote: > Perhaps Iâm not doing things correctly, but this code will take about 1 > minute to execute (2400 records on a total of around 44000 records): > > for(INT nCurrRow=1;nCurrRow<=nRows;nCurrRow++) >

Re: [sqlite] UPDATE query: why is that code sooo slow?

2005-01-22 Thread Clay Dowling
Gwendolynn ferch Elydyr wrote: I seem to recall that there was a significant performance difference between using sqlite3_exec vs prepared statements. You might try using sqlite3_prepare/bind/finalize. I would add that you need to do all of your database retreiving before starting the updating.

RE: [sqlite] UPDATE query: why is that code sooo slow?

2005-01-22 Thread Gwendolynn ferch Elydyr
On Sat, 22 Jan 2005, Luc Vandal wrote: Wrap he updates in a transaction. I'm already doing that (unless I'm doing it wrong?): nRet = sqlite3_exec( m_pDB, _T("BEGIN;"), 0, 0, ); ... nRet = sqlite3_exec( m_pDB, _T("COMMIT;"), 0, 0, ); I seem to recall that there was a significant performance

Re: [sqlite] UPDATE query: why is that code sooo slow?

2005-01-22 Thread Scott Wilkinson
Luc Vandal wrote: Hi, Perhaps I’m not doing things correctly, but this code will take about 1 minute to execute (2400 records on a total of around 44000 records): Wrap he updates in a transaction. See http://www.sqlite.org/lang_transaction.html for the syntax. -- Scott Wilkinson MICROS