Re: Trouble with Savepoints in postgres

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: Trouble with Savepoints in postgres
Дата
Msg-id 47DC1423.7000508@postnewspapers.com.au
обсуждение исходный текст
Ответ на Re: Trouble with Savepoints in postgres  (sam <sam.mahindrakar@gmail.com>)
Список pgsql-general
sam wrote:

> FUNCTION UPDATE ()
> BEGIN
>  UPDATE statement
>
>  EXCEPTION
> END
>
>
> when one record fails data only for that is rolled back the rest of
> the data is saved. EXCEPTION has to be caught.
>
>
As I recently found out, too many savepoints really kill PostgreSQL's
performance in a transaction. A function inserting/updating, say,
100,000 records will perform OK, but statements run in the same
transaction after the function completes will be very slow.

So ... if you find that after your big update statement performance is
terrible, you might need to explicitly check the conditions that might
result in an exception and skip those records, thus avoiding the
EXCEPTION block.

--
Craig Ringer

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Trouble with Savepoints in postgres
Следующее
От: Clodoaldo
Дата:
Сообщение: Re: Reindex does not finish 8.2.6