Re: BUG #4204: COPY to table with FK has memory leak - Mailing list pgsql-hackers

From Tom Lane
Subject Re: BUG #4204: COPY to table with FK has memory leak
Date
Msg-id 5183.1212006507@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #4204: COPY to table with FK has memory leak  (Gregory Stark <stark@enterprisedb.com>)
Responses Re: BUG #4204: COPY to table with FK has memory leak  (Gregory Stark <stark@enterprisedb.com>)
Re: BUG #4204: COPY to table with FK has memory leak  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-hackers
Gregory Stark <stark@enterprisedb.com> writes:
> "Tom Lane" <tgl@sss.pgh.pa.us> writes:
>> This is expected to take lots of memory because each row-requiring-check
>> generates an entry in the pending trigger event list.

> Hm, it occurs to me that we could still do a join against the pending event
> trigger list... I wonder how feasible it would be to store the pending trigger
> event list in a temporary table instead of in ram.

We could make that list spill to disk, but the problem remains that
verifying the rows one at a time will take forever.

The idea that's been kicked around occasionally is that once you get
past N pending events, throw them all away and instead queue a single
operation to do a bulk verify (just like initial establishment of the
FK constraint).  I'm not sure how to do the queue management for this
though.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Pavel Stehule"
Date:
Subject: Re: Packages in oracle Style
Next
From: Simon Riggs
Date:
Subject: Re: Avoiding second heap scan in VACUUM