Using a COPY...FROM through JDBC?

Поиск
Список
Период
Сортировка
От Steve Wampler
Тема Using a COPY...FROM through JDBC?
Дата
Msg-id 1086466349.29063.76.camel@weaver.tuc.noao.edu
обсуждение исходный текст
Ответы Re: [JDBC] Using a COPY...FROM through JDBC?  (Markus Schaber <schabios@logi-track.com>)
Re: [JDBC] Using a COPY...FROM through JDBC?  (Kris Jurka <books@ejurka.com>)
Список pgsql-performance
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.

В списке pgsql-performance по дате отправления:

Предыдущее
От: Laurent Martelli
Дата:
Сообщение: Re: Unused table of view
Следующее
От: Harald Fuchs
Дата:
Сообщение: Re: Slow in morning hours