Alan Stange wrote:
>> Especially since you are already using addBatch, there doesn't seem to
>> be much point in jamming two commands into one batch.
> Network latency. We were able to greatly increase performance this way
> by reducing the number of round trips.
If you give the development driver multiple queries via *multiple*
addBatch() calls, it will avoid the extra round trips.
i.e. if you do:
stmt.addBatch("CREATE TABLE ...");
then the driver will only do one round trip.
There is a limit of somewhere around 100 queries per round-trip (from
memory) due to some issues with avoiding network deadlocks, but in
practice that won't have much effect on performance.
AFAIK this is exactly what addBatch/executeBatch is there for. It's just
that the older driver was not particularly smart about handling this
case, so you had to shoehorn multiple statements into one query to get
the same effect.
Both driver versions should handle multiple queries per query string if
you use the normal query execution interface rather than the batch
interface. The older driver doesn't handle multiple resultsets per
query, but multiple updates (or other queries that do not return
results) should be fine.
In response to
pgsql-jdbc by date
|Next:||From: Aaron Mulder||Date: 2004-11-02 21:12:10|
|Subject: Re: 1300 to 3100 lines of code for XA support|
|Previous:||From: Alan Stange||Date: 2004-11-02 20:44:40|
|Subject: Re: executeBatch() issue with new driver?|