Re: ERROR: Memory exhausted in AllocSetAlloc(188) - Mailing list pgsql-general

From Tom Lane
Subject Re: ERROR: Memory exhausted in AllocSetAlloc(188)
Date
Msg-id 11909.1053550994@sss.pgh.pa.us
Whole thread Raw
In response to Re: ERROR: Memory exhausted in AllocSetAlloc(188)  ("Jim C. Nasby" <jim@nasby.net>)
Responses Re: ERROR: Memory exhausted in AllocSetAlloc(188)  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-general
"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

pgsql-general by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: PostgreSQL Performance on OpenBSD
Next
From: Bruno Wolff III
Date:
Subject: Re: PRIMARY KEYS