Re: Fastest way to load data in a table - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Fastest way to load data in a table
Date
Msg-id 20010926204047.A26521@svana.org
Whole thread Raw
In response to Fastest way to load data in a table  (Antonio Navarro Navarro <hostmaster@bemarnet.es>)
List pgsql-general
On Wed, Sep 26, 2001 at 11:17:10AM +0200, Antonio Navarro Navarro wrote:
> Hi all.
>
> I need to clean and fill periodically a database with several hundred thousands
> records readed from a plain ascii file.
>
> I have a Python script that opens the file and then, after a 'DELETE *
> FROM table'  submits an INSERT for each registry, but this process is very slow.
>
> How can I accelerate this uploading process ?

Are you using BEGIN and COMMIT to avoid transaction overhead?
What about using COPY?
What about using TRUNCATE?

HTH,
--
Martijn van Oosterhout <kleptog@svana.org>
http://svana.org/kleptog/
> Magnetism, electricity and motion are like a three-for-two special offer:
> if you have two of them, the third one comes free.

pgsql-general by date:

Previous
From: Antonio Navarro Navarro
Date:
Subject: Fastest way to load data in a table
Next
From: John Clark Naldoza y Lopez
Date:
Subject: PHP Related Problem