Re: Batches of single-insert statements vs batches of multi-insert statements - Mailing list pgsql-jdbc

Hi Christopher,

>Could someone educate me as to what happens internally to the JDBC single-insert batch that makes it so different from a multi-insert batch?

There are significant overheads at the database level itself to initialize and cleanup resources required for a "insert values" statement.
This is a known issue for backend developers, however it does not seem to have easy solution.

>If this should not be done in the JDBC driver, then in which area could such handling be done?
>Or have I missed something?

Believe me or not, pgjdbc has already that feature implemented.

The feature is disabled by default (so everybody can give it a try before we make it default), and we plan to activate it by default.
To activate multi-inserts, you should add reWriteBatchedInserts=true connection parameter.
You need 9.4.1209-SNAPSHOT version (you can grab that from Maven Central or build from sources).

We all would be grateful if you could test it and let us know if it works for you.

Vladimir 

pgsql-jdbc by date:

Previous
From: Christopher Deckers
Date:
Subject: Batches of single-insert statements vs batches of multi-insert statements
Next
From: Christopher Deckers
Date:
Subject: Re: Batches of single-insert statements vs batches of multi-insert statements