Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 976AC474E71 for ; Sat, 13 Apr 2002 16:06:18 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g3DK5LF17517; Sat, 13 Apr 2002 16:05:21 -0400 (EDT) To: Stephan Szabo Cc: "Nigel J. Andrews" , pgsql-general Subject: Re: COPY performance In-reply-to: <20020413121415.J86939-100000@megazone23.bigpanda.com> References: <20020413121415.J86939-100000@megazone23.bigpanda.com> Comments: In-reply-to Stephan Szabo message dated "Sat, 13 Apr 2002 12:18:59 -0700" Date: Sat, 13 Apr 2002 16:05:21 -0400 Message-ID: <17514.1018728321@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200204/537 X-Sequence-Number: 23252 Stephan Szabo writes: > On Sat, 13 Apr 2002, Nigel J. Andrews wrote: >> I should have mentioned that I'm doing the copy in to the table in a >> transaction block with all constraints deferred. That should mean it's only at >> the commit stage that foreign key will be checked right? > With the definition shown, I believe your constraint is not deferrable so > setting the constraint mode to deferred won't help. In any case it'd still > need to be saving the information on the triggers to run. In any case the RI trigger firings will be postponed till end of query. I suspect that the memory growth is due to the list of pending trigger firings. The advice to add the REFERENCES constraint after you've loaded the table seems good to me. Another possibility is that there's some memory leak associated with the txtidx data type; I dunno how thoroughly that type has been tested... regards, tom lane