Re: Trigger with WHEN clause (WIP)

Поиск
Список
Период
Сортировка
От Dimitri Fontaine
Тема Re: Trigger with WHEN clause (WIP)
Дата
Msg-id m21vl4e3jf.fsf@hi-media.com
обсуждение исходный текст
Ответ на Re: Trigger with WHEN clause (WIP)  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Trigger with WHEN clause (WIP)  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Список pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:
> That argument is based on a completely evidence-free assumption, namely
> that this patch would make your case faster.  Executing the WHEN tests
> is hardly going to be zero cost.  It's not too hard to postulate cases
> where implementing a filter this way would be *slower* than doing it
> inside the trigger.

It's pretty often the case (IME) that calling a trigger is the only
point in the session where you fire plpgsql, and that's a visible
cost. Last time I had to measure it, it was 1ms per call. We were trying
to optimize queries running in 3ms to 4ms, called more than 100 times a
second (in parallel on multi core architecture, but still).

The way I understand it, having the WHEN clause in CREATE TRIGGER would
allow to filter out some interpreter initialisations.

Regards,
-- 
dim


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: inefficient use of relation extension?
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Trigger with WHEN clause (WIP)