Re: importing large files - Mailing list pgsql-general

From Dimitri Fontaine
Subject Re: importing large files
Date
Msg-id 200710012130.53667.dfontaine@hi-media.com
Whole thread Raw
In response to importing large files  ("olivier.scalbert@algosyn.com" <olivier.scalbert@algosyn.com>)
List pgsql-general
Hi,

Le Friday 28 September 2007 10:22:49 olivier.scalbert@algosyn.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

pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: PostgreSQL Conference Fall 2007, final schedule
Next
From: Dimitri Fontaine
Date:
Subject: Re: Data cube in PostgreSQL