Yes, putting a large number of inserts that affect the same table(s) into ona bulk transaction can be a huge speedup, because the operations can take place in memory without having to reach the disk surface until commit time.
The optimal number of inserts/transaction depends on your hardware setup and who else needs access to CPU and I/O resources. -----Ursprüngliche Nachricht----- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von Michele Pradella Gesendet: Sonntag, 05. Februar 2017 09:42 An: SQLite mailing list <sqlite-users@mailinglists.sqlite.org> Betreff: [sqlite] Transactions Hi all, I have a question about transactions and SQLite: Do you think transactions are useful only when you have to do a sequence of statements that depends on each other and you need a way to rollback all statements if something goes wrong? or you can use transactions even with not interdependent statements for performance reason? and if yes do you think there's a trade-off about the number of query number in each transaction? I'm think about 1000 INSERT query to execute, is transaction works better because you do not have to change index at any insert but just one time on commit? _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users ___________________________________________ Gunter Hick Software Engineer Scientific Games International GmbH FN 157284 a, HG Wien Klitschgasse 2-4, A-1130 Vienna, Austria Tel: +43 1 80100 0 E-Mail: h...@scigames.at This communication (including any attachments) is intended for the use of the intended recipient(s) only and may contain information that is confidential, privileged or legally protected. Any unauthorized use or dissemination of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender by return e-mail message and delete all copies of the original communication. Thank you for your cooperation. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users