Re: Batches of single-insert statements vs batches of multi-insert statements

Поиск
Список
Период
Сортировка
От Vladimir Sitnikov
Тема Re: Batches of single-insert statements vs batches of multi-insert statements
Дата
Msg-id CAB=Je-FLY9U4wfK_csoZH2cPSrna5EhZMsCUK+aE=8iwOyfbBA@mail.gmail.com
обсуждение исходный текст
Ответ на Batches of single-insert statements vs batches of multi-insert statements  (Christopher Deckers <chrriis@gmail.com>)
Ответы Re: Batches of single-insert statements vs batches of multi-insert statements  (Christopher Deckers <chrriis@gmail.com>)
Re: Batches of single-insert statements vs batches of multi-insert statements  (Thomas Kellerer <spam_eater@gmx.net>)
Re: Batches of single-insert statements vs batches ofmulti-insert statements  (Christopher Deckers <chrriis@gmail.com>)
Re: Batches of single-insert statements vs batches of multi-insertstatements  (Thomas Kellerer <spam_eater@gmx.net>)
Список 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 по дате отправления:

Предыдущее
От: Christopher Deckers
Дата:
Сообщение: Batches of single-insert statements vs batches of multi-insert statements
Следующее
От: Christopher Deckers
Дата:
Сообщение: Re: Batches of single-insert statements vs batches of multi-insert statements