Re: autocommit (true/false) for more than 1 million records - Mailing list pgsql-performance

From David Johnston
Subject Re: autocommit (true/false) for more than 1 million records
Date
Msg-id CAKFQuwYaGZmpv6ZxNqifs0DNw2y_-Pf2CcR55zuK8fACjr0eMw@mail.gmail.com
Whole thread Raw
In response to Re: autocommit (true/false) for more than 1 million records  (Emi Lu <emilu@encs.concordia.ca>)
List pgsql-performance



On Mon, Aug 25, 2014 at 9:40 AM, Emi Lu <emilu@encs.concordia.ca> wrote:

By the way, could someone let me know why set autocommit(false) is for sure faster than true please? Or, some online docs talk about this.


​Not sure about the docs specifically but:

Commit is expensive because as soon as it is issued all of the data has to be guaranteed written.  ​While ultimately the same amount of data is guaranteed by doing them in batches there is opportunity to achieve economies of scale.

(I think...)
When you commit you flush data to disk - until then you can make use of RAM.  Once you exhaust RAM you might as well commit and free up that RAM for the next batch.

David J.

pgsql-performance by date:

Previous
From: Emi Lu
Date:
Subject: Re: autocommit (true/false) for more than 1 million records
Next
From: Felipe Santos
Date:
Subject: Re: autocommit (true/false) for more than 1 million records