Re: batch inserts are "slow"

From: Christopher Petrilli <petrilli(at)gmail(dot)com>
To: tim(at)se(dot)linux(dot)org
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: batch inserts are "slow"
Date: 2005-05-03 19:17:20
Message-ID: 59d991c4050503121725619c6d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 5/3/05, Tim Terlegård <tim(at)se(dot)linux(dot)org> wrote:
> > Just as on Oracle you would use SQL*Loader for this application, you
> > should use the COPY syntax for PostgreSQL. You will find it a lot
> > faster. I have used it by building the input files and executing
> > 'psql' with a COPY command, and also by using it with a subprocess,
> > both are quite effective.
>
> I tried this now. Now it's down to 0.45 seconds. It feels a bit hacky to
> run /usr/bin/psql from java, but it sure works. Thanks for the hint!

It may feel hacky, but I think if you want to use SQL*Loader on
Oracle, you have to do the same thing. I know a C++ app that I use
that runs SQL*Loader about once per second to deal with a HUGE volume
(10K/sec). In fact, moving the load files onto ramdisk has helped a
lot.

Chris
--
| Christopher Petrilli
| petrilli(at)gmail(dot)com

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Dave Cramer 2005-05-03 19:58:59 Re: batch inserts are "slow"
Previous Message Mischa Sandberg 2005-05-03 18:53:17 Re: COPY vs INSERT