Thx, very helpfull reply. One more question: is it need to do "END" after "BEGIN" or enought "COMMIT"?

By the way, some edition of sql query improve productivity a little bit too:

// Columns in 'data' table defined like (INTEGER, INTEGER, INTEGER, TEXT)
char * sql = sqlite3_mprintf( "INSERT INTO data VALUES( '%q', '%q', '%q', '%q' )",
     m_sources_map[ it->m_source ].m_sid.c_str(),
     sec.c_str(), usec.c_str(), it->m_value.c_str() );

was changed with:

// Columns in 'data' table defined like (INTEGER, INTEGER, INTEGER, TEXT)
char * sql = sqlite3_mprintf( "INSERT INTO data VALUES( %d, %d, %d, '%s' )",
     m_sources_map[ it->m_source ].m_sid,
     it->m_time.sec(), it->m_time.usec(), it->m_value.c_str() );

A common issue of high latency transactions. SQLite has a high per-transaction overhead, which can be amortized across multiple INSERTs or UPDATEs to improve the average INSERT rate. You are doing a single INSERT per transaction, so wrap multiple INSERTs inside a single "BEGIN" ... "END" transaction.

See:
http://www.sqlite.org/cvstrac/wiki?p=PerformanceConsiderations

Christian

--
Regards,
Igor Mironchick,
Intervale ©
#ICQ 492-597-570


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

Reply via email to