Skip site navigation (1) Skip section navigation (2)

Re: Poor addBatch performance. Why dosn't it use copy ?

From: Giuseppe Sacco <giuseppe(at)eppesuigoccas(dot)homedns(dot)org>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Poor addBatch performance. Why dosn't it use copy ?
Date: 2007-04-20 12:54:59
Message-ID: 1177073699.5343.45.camel@scarafaggio (view raw or flat)
Thread:
Lists: pgsql-jdbc
[send post, since the first one was rejected by MTA]

Hi femski,

Il giorno ven, 20/04/2007 alle 04.39 -0700, femski ha scritto:
[...]
> Why doesn't the Postgres JDBC driver use "copy" for faster bulk insert ?
> What is the best way to speedup
> do bulk insert at this time or in near future (I was to use standard JDBC
> API) ?

I use addBatch() very often when, but I use it with statement that work
on different tables. I think it would really be difficult to check if
the statements are referring the same table and the same field.

Why don't you write all record in one insert statement like "INSERT INTO
table (fields) VALUES (...,...), (...,...), (...,..);" I think both
oracle and postgres 8.2 should accept this syntax.

Bye,
Giuseppe

In response to

Responses

pgsql-jdbc by date

Next:From: Ido M. TamirDate: 2007-04-20 14:02:32
Subject: Re: Poor addBatch performance. Why dosn't it use copy ?
Previous:From: femskiDate: 2007-04-20 11:39:37
Subject: Poor addBatch performance. Why dosn't it use copy ?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group