Skip site navigation (1) Skip section navigation (2)

Re: How import big amounts of data?

From: Teemu Torma <teemu(at)torma(dot)org>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: How import big amounts of data?
Date: 2005-12-29 14:41:05
Message-ID: 200512291541.05739.teemu@torma.org (view raw or flat)
Thread:
Lists: pgsql-performance
On Thursday 29 December 2005 10:48, Arnau wrote:
>    Which is the best way to import data to tables? I have to import
> 90000 rows into a column and doing it as inserts takes ages. Would be
> faster with copy? is there any other alternative to insert/copy?

I am doing twice as big imports daily, and found the follwing method 
most efficient (other than using copy):

- Use plpgsql function to do the actual insert (or update/insert if 
needed). 

- Inside a transaction, execute SELECT statements with maximum possible 
number of insert function calls in one go.  This minimizes the number 
of round trips between the client and the server.

Teemu

In response to

Responses

pgsql-performance by date

Next:From: ArnauDate: 2005-12-29 16:19:27
Subject: Re: How import big amounts of data?
Previous:From: RonDate: 2005-12-29 14:20:28
Subject: Re: How import big amounts of data?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group