Re: Triggers and locking - Mailing list pgsql-general

From Alban Hertroys
Subject Re: Triggers and locking
Date
Msg-id C6883200-0E84-4833-B5BA-B3A7D1F76650@solfertje.student.utwente.nl
Whole thread Raw
In response to Triggers and locking  (William Temperley <willtemperley@gmail.com>)
Responses Re: Triggers and locking
List pgsql-general
On 21 Sep 2010, at 16:13, William Temperley wrote:

> Dear all,
>
> I have a single "source" table that is referenced by six
> specialization tables, which include:
> "journal_article"
> "report"
> 4 more....
>
> e.g.:
> """
> update source set citation = get_report_citation(
>    (select source from source where id = NEW.source_ptr_id),
>    NEW
> );
> """

Well, depending on how many rows are in source, updating them all can take a while.
Eventually those changes will have to go to disk, so it's probably pretty much I/O-bound.

I get the impression you're missing a WHERE clause on that UPDATE statement though, or otherwise I can't understand why
you'dwant to update all citations every time one source record changes. 


Alban Hertroys

--
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.


!DSPAM:737,4c98edf010251425489017!



pgsql-general by date:

Previous
From: "Joshua J. Kugler"
Date:
Subject: Re: trying to use libpq in Ubuntu
Next
From: Merlin Moncure
Date:
Subject: Re: Memory Errors