Search Postgresql Archives

Re: what are rules for?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux