Re: in Pl/PgSQL, do commit every 5000 records

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: in Pl/PgSQL, do commit every 5000 records
Дата
Msg-id 20060310155601.GA21877@wolff.to
обсуждение исходный текст
Ответ на in Pl/PgSQL, do commit every 5000 records  (Emi Lu <emilu@encs.concordia.ca>)
Ответы Re: in Pl/PgSQL, do commit every 5000 records
Список pgsql-general
On Fri, Mar 10, 2006 at 09:36:16 -0500,
  Emi Lu <emilu@encs.concordia.ca> wrote:
> Good morning,
>
> In a plpgsql function, I am trying to insert 900, 000 records into
> several tables. I remembered people mentioned before that it is better
> and more efficient to commit actions for let's say every 5000 records'
> insertion.

You can't do commits inside of a function. I think you are misremembering
advice about not do inserts with a transaction per row which will have
a lot of overhead for all of the commits.

You can do savepoints inside of a function, but those are going to slow things
down, not speed them up.

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

Предыдущее
От: Emi Lu
Дата:
Сообщение: About updates
Следующее
От: Emi Lu
Дата:
Сообщение: Re: in Pl/PgSQL, do commit every 5000 records