Re: Really bad insert performance: what did I do wrong?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Really bad insert performance: what did I do wrong?
Дата
Msg-id 2703.1045887827@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Really bad insert performance: what did I do wrong?  ("scott.marlowe" <scott.marlowe@ihs.com>)
Список pgsql-performance
"scott.marlowe" <scott.marlowe@ihs.com> writes:
> 3:  Inserting ALL 700,000 rows in one transaction is probably not optimal.
> Try putting a test in every 1,000 or 10,000 rows to toss a "commit;begin;"
> pair at the database while loading.  Inserting all 700,000 rows at once
> means postgresql can't recycle the transaction logs, so you'll have
> 700,000 rows worth of data in the transaction logs waiting for you to
> commit at the end.

That was true in 7.1.0, but we got rid of that behavior *very* quickly
(by 7.1.3, according to the release notes).  Long transactions do not
currently stress the WAL storage any more than the same amount of work
in short transactions.

Which is not to say that there's anything wrong with divvying the work
into 1000-row-or-so transactions.  I agree that that's enough to push
the per-transaction overhead down into the noise.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Really bad insert performance: what did I do wrong?
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: performance issues for processing more then 150000