COPY problem - Mailing list pgsql-general

From Creager, Robert S
Subject COPY problem
Date
Msg-id 10FE17AD5F7ED31188CE002048406DE8514CEE@lsv-msg06.stortek.com
Whole thread Raw
Responses Re: COPY problem
Re: COPY problem
List pgsql-general
I think this is a question regarding the backend, but...

I'm in the process of changing 1 large table (column wise) into 6 smaller
tables, and ran into a situation.  I'm using Postgresql 7.1beta5, Pg as
included, Perl 5.6, Solaris 2.6 on an Ultra 5.

The new setup is 6 tables, the 'main' table loc with id SERIAL, while the
other 5 (u,b,v,r,i) are identical, id INT4 REFERENCES loc.

What I've done is copy the original table into a file, and am now attempting
to copy from stdin, using Perl/Pg to break out the data into the 6 tables.
I'm working with 2.5 million records btw.  I've narrowed the situation to
occur when copying to any one of the 5 referring tables (COPY u FROM stdin).
The backend process which handles the db connection decides that it needs a
whole lot of memory, although in a nice controlled manner.  The backend
starts with using 6.5Mb, and at 25000 records copied, it's taken 10Mb and
has slowed down substantially.  Needless to say, this COPY will not finish
before running out of memory (estimated 300Mb).  When executing the COPY to
the loc table, this problem does not occur.  Am I going to have to resort to
inserts for the referring tables?

Robert Creager
Senior Software Engineer
Client Server Library
303.673.2365 V
303.661.5379 F
888.912.4458 P
StorageTek
INFORMATION made POWERFUL



pgsql-general by date:

Previous
From: Mike Mascari
Date:
Subject: RE: How to use locks, for DB noivces?
Next
From: Tom Lane
Date:
Subject: Re: what's going on here?