Re: Multiple insert performance trick or performance misunderstanding?
В списке pgsql-performance по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: Multiple insert performance trick or performance misunderstanding? |
| Дата | |
| Msg-id | 23702.1127596541@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Multiple insert performance trick or performance misunderstanding? (Ron Mayer <rm_pg@cheapcomplexdevices.com>) |
| Список | pgsql-performance |
Ron Mayer <rm_pg@cheapcomplexdevices.com> writes:
> Is it expected that I'd be better off sending big
> concatenated strings like
> "insert into tbl (c1,c2) values (v1,v2);insert into tbl (c1,c2) values (v3,v4);..."
> instead of sending them one at a time?
It's certainly possible, if the network round trip from client to server
is slow. I do not think offhand that there is any material advantage
for the processing within the server (assuming you've wrapped the whole
thing into one transaction in both cases); if anything, the
concatenated-statement case is probably a bit worse inside the server
because it will transiently eat more memory. But network latency or
client-side per-command overhead could well cause the results you see.
regards, tom lane
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера