On Sun, Feb 05, 2017 at 09:41:48AM +0100, Michele Pradella wrote:
> 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?

Anecdotally, I can say that I've experimented and see huge speedups in 
building up a database on both HDD's with a few tens of megabytes of cache 
and on SSD's by batching up individual INSERTs and UPDATEs into groups 
through a transaction.

I've experimented with batching various numbers of INSERTS when 
building up a new database from another local data source and wound 
up with 100 or 1000, which may not be optimal but was fast enough.

-Nathan
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to