Re: importing large files

From: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: "olivier(dot)scalbert(at)algosyn(dot)com" <olivier(dot)scalbert(at)algosyn(dot)com>
Subject: Re: importing large files
Date: 2007-10-01 19:30:53
Message-ID: 200710012130.53667.dfontaine@hi-media.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Le Friday 28 September 2007 10:22:49 olivier(dot)scalbert(at)algosyn(dot)com, vous avez
écrit :
> I need to import between 100 millions to one billion records in a
> table. Each record is composed of two char(16) fields. Input format
> is a huge csv file.I am running on a linux box with 4gb of ram.
> First I create the table. Second I 'copy from' the cvs file. Third I
> create the index on the first field.
> The overall process takes several hours. The cpu seems to be the
> limitation, not the memory or the IO.
> Are there any tips to improve the speed ?

If you don't need to fire any trigger and trust the input data, then you may
benefit from the pgbulkload project:
http://pgbulkload.projects.postgresql.org/

The "conditions of usage" may be lighter than what I think they are, though.

Regards,
--
dim

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dimitri Fontaine 2007-10-01 19:39:40 Re: Data cube in PostgreSQL
Previous Message Joshua D. Drake 2007-10-01 19:24:00 Re: [GENERAL] PostgreSQL Conference Fall 2007, final schedule