pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Steve Wampler <swampler@noao.edu>
To: Postgres-JDBC <pgsql-jdbc@postgresql.org>
To: Postgres-performance <pgsql-performance@postgresql.org>
Subject: Using a COPY...FROM through JDBC?
Date: Sat, 05 Jun 2004 13:12:29 -0700
Message-ID: <1086466349.29063.76.camel@weaver.tuc.noao.edu> (raw)


I've got a simple database (no indices, 6 columns) that I need
to write data quickly into through JDBC connections from
multiple such connections simultaneously in a distributed
environment.  (This is going to be a message logging service
for software generated messages.)

Using a PreparedStatement, I can get about 400/s inserted.  If I
(on the java side) buffer up the entries and dump them in large
transaction blocks I can push this up to about 1200/s.  I'd
like to go faster.  One approach that I think might be
promising would be to try using a COPY command instead of
an INSERT, but I don't have a file for input, I have a 
Java collection, so COPY isn't quite right.  Is there anyway to
efficiently use COPY without having to create a file (remember
that the java apps are distributed on a LAN and aren't running
on the DB server.)  Is this a dead end because of the way
COPY is implemented to only use a file?

Is there something else I can do?  Ultimately, this will end
up on a machine running 1+0 RAID, so I expect that will give
me some performance boost as well, but I'd like to push it
up as best I can with my current hardware setup.

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



view thread (7+ messages)  latest in thread

Message-ID: <1086466349.29063.76.camel@weaver.tuc.noao.edu>
Permalink:  ../1086466349.29063.76.camel@weaver.tuc.noao.edu/
Also on:    postgresql.org/message-id/1086466349.29063.76.camel@weaver.tuc.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, pgsql-jdbc@postgresql.org
  Subject: Re: Using a COPY...FROM through JDBC?
  In-Reply-To: <1086466349.29063.76.camel@weaver.tuc.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