Re: Postgres insert performance and storage requirement compared to Oracle - Mailing list pgsql-performance

From Jon Nelson
Subject Re: Postgres insert performance and storage requirement compared to Oracle
Date
Msg-id AANLkTinntqfT1b9xaRfGGqVwwsGhyA7=JhLsuQ10Xzyy@mail.gmail.com
Whole thread Raw
In response to Re: Postgres insert performance and storage requirement compared to Oracle  (Mladen Gogala <mladen.gogala@vmsinfo.com>)
Responses Re: Postgres insert performance and storage requirement compared to Oracle
List pgsql-performance
On Tue, Oct 26, 2010 at 4:02 PM, Mladen Gogala
<mladen.gogala@vmsinfo.com> wrote:
> On 10/26/2010 11:41 AM, Merlin Moncure wrote:
>>
>> yup, that's exactly what I mean -- this will give you more uniform
>> insert performance (your temp table doesn't even need indexes).  Every
>> N records (say 10000) you send to permanent and truncate the temp
>> table.  Obviously, this is more fragile approach so weigh the
>> pros/cons carefully.
>>
>> merlin
>
> Truncate temporary table? What a horrible advice! All that you need is the
> temporary table to delete rows on commit.

I believe Merlin was suggesting that, after doing 10000 inserts into
the temporary table, that something like this might work better:

start loop:
  populate rows in temporary table
  insert from temporary table into permanent table
  truncate temporary table
  loop

I do something similar, where I COPY data to a temporary table, do
lots of manipulations, and then perform a series of INSERTS from the
temporary table into a permanent table.

--
Jon

pgsql-performance by date:

Previous
From: André Volpato
Date:
Subject: Re: AIX slow buffer reads
Next
From: Mladen Gogala
Date:
Subject: Re: Postgres insert performance and storage requirement compared to Oracle