Re: Rules and Triggers

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Rules and Triggers
Дата
Msg-id web-1461719@davinci.ethosmedia.com
обсуждение исходный текст
Ответ на Rules and Triggers  (Ludwig Lim <lud_nowhere_man@yahoo.com>)
Ответы Re: Rules and Triggers  (Jan Wieck <janwieck@yahoo.com>)
Список pgsql-sql
Ludwig,

>   I tried converting the rule to function & trigger
> and it reported that it used an Index scan given the
> same INSERT statement.
> 
>    I was wondering why the rule used sequentail scan
> and the equivalent function trigger used index scan.

This is one of the documented differences between rules and triggers
(at least, I've seen it in the documentation *somewhere*).  I can't
tell you "why", though ... hopefully Tom or Bruce will speak to that.

For myself, I use triggers for most things, and rules just for
updatable views.  Aside for index efficiency, rules are a Postgres-only
thing, whereas several RDBMS's support triggers.   Gives me marginally
better portability.

-Josh Berkus


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

Предыдущее
От: Ludwig Lim
Дата:
Сообщение: Rules and Triggers
Следующее
От: juerg.rietmann@pup.ch
Дата:
Сообщение: how to build this list ?