Re: Multiple Row Insert vs. Batch
От | Robert DiFalco |
---|---|
Тема | Re: Multiple Row Insert vs. Batch |
Дата | |
Msg-id | CAAXGW-zUpAc5XaAi-Rm0o=zMY8a=DwscHzntSJtJkX7f2oXXaw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Multiple Row Insert vs. Batch (Robert DiFalco <robert.difalco@gmail.com>) |
Ответы |
Re: Multiple Row Insert vs. Batch
|
Список | pgsql-jdbc |
I did a benchmark and multi-row insert with a single statement is about 6-7% faster than batch insert. This is for 250 rows executed a thousand times in a loop (alternating between the two to reduce subsequent table insert index slowdown). So a little faster but not significantly so.
On Sat, Jun 6, 2015 at 12:07 PM, Robert DiFalco <robert.difalco@gmail.com> wrote:
Yes that's correct. A multiple row insert with a single insert statement. I'll try benchmarking the two on Monday. My guess is that they are pretty damn similar.
Sent from my iPhoneRobert ??Is that what you meant ?On 6 June 2015 at 13:34, Vitalii Tymchyshyn <vit@tym.im> wrote:I think OP meant something like
Insert into table values (?,?,?),(?,?,?),...,(?,?,?);
Vs batch of insert into table values(?,?,?);I really think first would be faster up to a certain amount of rows, but test is needed to check.
Vitalii Tymchyshyn
Сб, 6 черв. 2015 13:30 Dave Cramer <pg@fastcrypt.com> пише:batch should be faster and if it isn't we did something wrongOn 6 June 2015 at 12:34, Robert DiFalco <robert.difalco@gmail.com> wrote:Say I need to insert 250 rows. Is single-statement multiple row insert or JDBC batch likely to be faster?Thanks!R.
В списке pgsql-jdbc по дате отправления: