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

Поиск
Список
Период
Сортировка
От David G Johnston
Тема Re: autocommit (true/false) for more than 1 million records
Дата
Msg-id 1408741114012-5815946.post@n5.nabble.com
обсуждение исходный текст
Ответ на autocommit (true/false) for more than 1 million records  (Emi Lu <emilu@encs.concordia.ca>)
Список pgsql-performance
Emi Lu-2 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)
>
> Thanks a lot!
> Emi

Typically the larger the n the better.  Locking and risk of data loss on a
failure are the tradeoffs to consider.  Other factors, like memory, make
choosing too large an n bad so using 500,000 is probably wrong but 500 is
probably overly conservative.  Better advice depends on context and
hardware.

You should also consider upgrading to a newer, supported, version of
PostgreSQL.

David J.





--
View this message in context:
http://postgresql.1045698.n5.nabble.com/autocommit-true-false-for-more-than-1-million-records-tp5815943p5815946.html
Sent from the PostgreSQL - performance mailing list archive at Nabble.com.


В списке pgsql-performance по дате отправления:

Предыдущее
От: Emi Lu
Дата:
Сообщение: autocommit (true/false) for more than 1 million records
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: autocommit (true/false) for more than 1 million records