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

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Emi Lu <emilu(at)encs(dot)concordia(dot)ca>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: autocommit (true/false) for more than 1 million records
Date: 2014-08-22 21:00:18
Message-ID: 20140822210018.GZ16422@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

* Emi Lu (emilu(at)encs(dot)concordia(dot)ca) wrote:
> Hello,
>
> Trying to insert into one table with 1 million records through java
> JDBC into psql8.3. May I know (1) or (2) is better please?
>
> (1) set autocommit(true)
> (2) set autocommit(false)
> commit every n records (e.g., 100, 500, 1000, etc)

It depends on what you need.

Data will be available to concurrent processes earlier with (1), while
(2) will go faster.

Thanks,

Stephen

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Emi Lu 2014-08-22 21:11:01 Re: autocommit (true/false) for more than 1 million records
Previous Message David G Johnston 2014-08-22 20:58:34 Re: autocommit (true/false) for more than 1 million records