Re: Bulk Insert

From: Mladen Gogala <mladen(dot)gogala(at)vmsinfo(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Bulk Insert
Date: 2010-05-16 18:36:53
Message-ID: 4BF03B45.4000006@vmsinfo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On 05/16/2010 06:44 AM, Jasen Betts wrote:
> On 2010-05-16, David Jarvis<thangalin(at)gmail(dot)com> wrote:
>
>> --000e0cd516808361a40486acd38a
>> Content-Type: text/plain; charset=ISO-8859-1
>>
>> Hi,
>>
>> What is the fastest way to insert 237 million records into a table that has
>> rules (for distributing the data across 84 child tables)?
>>
> segregate the data first and then copy it into the child tables.
>
> else copy it into a temp table and insert it from there using
>
> insert into CHILD_NAME select * from TEMPNAME where SEGREGATION CONDITION;
>
> oryou may have success with the simple copy if you increase the number of file
> handles and buffers sufficiently.
>
>
>

If you segregate data, as Jasen suggests, you can even populate the
child tables in parallel, which should provide some performance improvement.

--
Mladen Gogala
Sr. Oracle DBA
1500 Broadway
New York, NY 10036
(212) 329-5251
www.vmsinfo.com
The Leader in integrated Media Intelligence Solutions

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tony Day 2010-05-18 04:02:36 What is locktype=transactionid ?
Previous Message Jasen Betts 2010-05-16 10:44:50 Re: Bulk Insert