Re: why autocommit mode is slow? - Mailing list pgsql-general

From Vick Khera
Subject Re: why autocommit mode is slow?
Date
Msg-id BANLkTi=NdWUiG5nNqYpi0duAFgK--P=arA@mail.gmail.com
Whole thread Raw
In response to why autocommit mode is slow?  (Szymon Guz <mabewlun@gmail.com>)
List pgsql-general
On Thu, Apr 7, 2011 at 4:59 PM, Szymon Guz <mabewlun@gmail.com> 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.

pgsql-general by date:

Previous
From: Gipsz Jakab
Date:
Subject: PostgreSQL + FreeBSD memory configuration, and an issue
Next
From: Vick Khera
Date:
Subject: Re: PostgreSQL + FreeBSD memory configuration, and an issue