pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Steve Wampler <swampler@noao.edu>
To: tim@se.linux.org
Cc: Christopher Petrilli <petrilli@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: batch inserts are "slow"
Date: Tue, 03 May 2005 11:29:54 -0700
Message-ID: <4277C322.2010901@noao.edu> (raw)
In-Reply-To: <Pine.LNX.4.44.0505031942180.8117-100000@naskur.se.linux.org>
References: <Pine.LNX.4.44.0505031942180.8117-100000@naskur.se.linux.org>

Tim TerlegÄrd 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!

There was a patch against 7.4 that provided direct JDBC access to
PostgreSQL's COPY.  (I have it installed here and *love* it - it
gives outstanding performance.)  However, it hasn't made into an
official release yet.  I don't know why, perhaps there's
a problem yet to be solved with it ('works for me', though)?

Is this still on the board?  I won't upgrade past 7.4 without it.

-- 
Steve Wampler -- swampler@noao.edu
The gods that smiled on your birth are now laughing out loud.



view thread (15+ messages)  latest in thread

Message-ID: <4277C322.2010901@noao.edu>
Permalink:  ../4277C322.2010901@noao.edu/
Also on:    postgresql.org/message-id/4277C322.2010901@noao.edu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: swampler@noao.edu, tim@se.linux.org, petrilli@gmail.com
  Subject: Re: batch inserts are "slow"
  In-Reply-To: <4277C322.2010901@noao.edu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox