Re: what are rules for?

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: what are rules for?
Дата
Msg-id 20080624144408.GA4822@alvh.no-ip.org
обсуждение исходный текст
Ответ на what are rules for?  ("Michael Shulman" <shulman@mathcamp.org>)
Список pgsql-general
Adam Rich wrote:

> One interesting example is having rules and triggers watching for
> deletes or updates on a table.  If many rows are modified, rules
> can be faster.  Take this statement:
>
> DELETE FROM mydata WHERE idval BETWEEN 10000 and 20000;
>
> Say this statement deletes 10,000 rows.  The delete trigger would
> get called 10,000 times whereas the rule is essentially executed
> once, since it can share the WHERE clause of the user's query.

This is a use case we should be able to better implement using FOR EACH
STATEMENT triggers, it seems.  We just need to be able to pass the list
of affected tuples to the trigger function, which until now has remained
unimplemented.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

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

Предыдущее
От: "Brandon Metcalf"
Дата:
Сообщение: Re: backslashes in 8.3.3
Следующее
От: David Siebert
Дата:
Сообщение: Probably been asked a hundred times before.