Re: stable for each row before insert trigger
От | Luca Ferrari |
---|---|
Тема | Re: stable for each row before insert trigger |
Дата | |
Msg-id | CAKoxK+51uQ71w1mR9_Rqrg7Bw8rvt3f-Bt01qON=_MykievWTQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: stable for each row before insert trigger (Олег Самойлов <splarv@ya.ru>) |
Список | pgsql-general |
On Fri, Oct 18, 2019 at 11:18 AM Олег Самойлов <splarv@ya.ru> wrote: > > STABLE indicates .... (It is inappropriate for AFTER triggers that wish to query rows modified by the current command.) > > So, STABLE is inappropriate for such trigger, but is appropriate for BEFORE trigger? > Well, a before trigger will not see data changes in any way, so I read it as "it does not matter for before triggers". And I would speculate that, being in a trigger, the function is invoked every time, so there should not be any caching that produces performance boosts. > For instance, I expect that the FOR EACH ROW BEFORE trigger marked as STABLE will be faster than VOLATILE without importantnegative side effects. I observed 3% benefit. IMMUTABLE trigger is slightly slower then STABLE, but I am not sure,too low difference. It could be faster, but I would not speculate on that rather than an inling of the code. Luca
В списке pgsql-general по дате отправления: