Fast inserts using SQLite

I am developing a data logging application that will write a row to a SQLite database approximately every 100ms. Without using transactions, inserting 100 rows in this interval takes 20 seconds - twice as long as necessary.

Does SQLite provide anything that can help with what I am trying to do, or is it dealing with a rollback of my own solution (e.g. committing a transaction every N rows or N seconds)?

+3


source to share


2 answers


Commit the transaction only when the new data value is not yet available; otherwise, write a new value in the same transaction.



This automatically switches transactions to the fastest sustainable speed.

+1


source


Did you consider "Naive Inserts"?



http://blog.quibb.org/2010/08/fast-bulk-inserts-into-sqlite/

+1


source







All Articles