Re: COPY performance - Mailing list pgsql-general

From Tom Lane
Subject Re: COPY performance
Date
Msg-id 17514.1018728321@sss.pgh.pa.us
Whole thread Raw
In response to Re: COPY performance  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Responses Re: COPY performance  ("Nigel J. Andrews" <nandrews@investsystems.co.uk>)
List pgsql-general
Stephan Szabo <sszabo@megazone23.bigpanda.com> 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

pgsql-general by date:

Previous
From: Joe Conway
Date:
Subject: Re: COPY performance
Next
From: "Nigel J. Andrews"
Date:
Subject: Re: COPY performance