On Wed, Aug 11, 2004 at 20:50:28 -0500, David Stanaway <[EMAIL PROTECTED]> wrote: > > I had thought about that, but this is a simpler case of what I need to > do. The operations for each column in the update are dependent on the > current and new values of each row being merged. > > Currently I am doing this with a cursor which is very slow! How about a > trigger on update? Or would this suffer the same behavior that I am > seeing with UPDATE FROM with a 1-many join?
There is a good chance that triggers would be faster since tablea seems to reallly be a materialized view of an aggregate over tableb and doing a delta calculation when a row changes is going to be faster than recalculating the aggregate from scratch. You won't have the same problem if you use a trigger as when you were trying to calculate an aggregate using UPDATE. ---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives? http://archives.postgresql.org