"Jim C. Nasby" <jim@nasby.net> writes:
> On Wed, May 21, 2003 at 04:39:18PM -0400, Tom Lane wrote:
>> Each pending deferred-trigger action takes about 40 bytes + palloc
>> overhead, probably 48 bytes altogether ... 48 * 35M comes to 1.68G, so
>> that's exactly where your problem is. I'd suggest trying to commit the
>> changes in smaller batches ...
> Ugh... would two triggers double that? Where can I get more info on
> what's happening under the covers here, especially on what a deferred
> trigger is?
A deferred trigger is an AFTER trigger. If you can do your work in
BEFORE triggers, you should.
Two triggers firing on the same row action (insert/update/delete) do not
double the memory --- there's one trigger queue entry per action. It
looks like it costs about 8 more bytes for each additional deferred
trigger that needs to be fired on the same row action.
Beyond that, read the code --- it's in backend/commands/trigger.c.
regards, tom lane