Re: Rule vs Trigger

Поиск
Список
Период
Сортировка
От Joshua D. Drake
Тема Re: Rule vs Trigger
Дата
Msg-id 46813C40.6020602@commandprompt.com
обсуждение исходный текст
Ответ на Re: Rule vs Trigger  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Tom Lane wrote:
> "Albe Laurenz" <all@adv.magwien.gv.at> writes:
>> Richard Broersma Jr wrote:

>> A rule would only
>> execute one additional statement. So if you can do it with a rule
>> conveniently, the rule will probably be faster.
>
> I find this unlikely.  The overhead involved in setting up a rule
> is probably larger than that involved in calling a trigger.
> The real question is whether you need access to the modified data
> or not --- a statement-level trigger doesn't currently get that.

Not that Tom ever needs any backing up, but when we started testing
partitioning, we first tested with rules and then tested with triggers.
Triggers are quite a bit faster than rules.

Joshua D. Drake


>
>             regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org/
>


--

       === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive  PostgreSQL solutions since 1997
              http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/


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

Предыдущее
От: Harald Fuchs
Дата:
Сообщение: Re: Duplicate records returned
Следующее
От: "news.gmane.org"
Дата:
Сообщение: Re: a JOIN on same table, but 'slided over'