On Thu, Apr 7, 2011 at 4:59 PM, Szymon Guz <mabewlun@xxxxxxxxx> wrote:
this is maybe a stupid question, but I don't know how to explain to my coworkers why performing many inserts in autocommit mode is so much slower than making all of them in one transaction.
as others have said, there is overhead in each transaction. the biggest of these is the file sync to disk of the write-ahead log. on spinning media this involves on average one rotation of the platter. when you batch the inserts, you save that sync per insert.