Re: autocommit (true/false) for more than 1 million records

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 






On Mon, Aug 25, 2014 at 9:40 AM, Emi Lu <emilu@xxxxxxxxxxxxxxxxx> 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.


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux