Re: [GENERAL] Catching errors inside a LOOP is causing performance issues

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [GENERAL] Catching errors inside a LOOP is causing performance issues
Дата
Msg-id 7669.1506535198@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [GENERAL] Catching errors inside a LOOP is causing performance issues  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: [GENERAL] Catching errors inside a LOOP is causing performanceissues  (Denisa Cirstescu <Denisa.Cirstescu@tangoe.com>)
Список pgsql-general
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> ​Not sure how much detail you are looking for but the docs say this:
> "​Tip: A block containing an EXCEPTION clause is significantly more
> expensive to enter and exit than a block without one. Therefore, don't use
> EXCEPTION without need."
> https://www.postgresql.org/docs/current/static/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING

> I'm somewhat doubting "plan caching" has anything to do with this; I
> suspect its basically that there is high memory and runtime overhead to
> deal with the possibilities of needing to convert a exception into a branch
> instead of allowing it to be fatal.

Yeah, it's about the overhead of setting up and ending a subtransaction.
That's a fairly expensive mechanism, but we don't have anything cheaper
that is able to recover from arbitrary errors.
        regards, tom lane


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

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

Предыдущее
От: Igor Polishchuk
Дата:
Сообщение: Re: [GENERAL] Rsync to a recovering streaming replica?
Следующее
От: Jerry Sievers
Дата:
Сообщение: Re: [GENERAL] WAL Archive command.