Re: Insert values() per-statement overhead

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Insert values() per-statement overhead
Дата
Msg-id 20160115103457.axvczo4on6wpfifw@alap3.anarazel.de
обсуждение исходный текст
Ответ на Insert values() per-statement overhead  (Vladimir Sitnikov <sitnikov.vladimir@gmail.com>)
Ответы Re: Insert values() per-statement overhead  (Vladimir Sitnikov <sitnikov.vladimir@gmail.com>)
Список pgsql-hackers
On 2016-01-15 13:17:12 +0300, Vladimir Sitnikov wrote:
> There is a finding that insert(x) values(y);insert(x) values(z);  is
> 2-4 times slower than insert(..) values(y),(z);
> see [1], [2].

If you indeed just mean statements like above, without begin/commit, a
large portion of the overhead will be transactional overhead. But
I guess you mean there's a transaction surrounding it?

If not, quite possibly what you're describing is client round trip
latency? How exactly are these issued? There'll be some overhead of
running two statements rather than one, but if you have neither added
transactional overhead, nor latency issues, the difference isn't *that*
big in my experience.

> Is it something that was discussed previously?

Yes.

I think the biggestoverhead here is that the executor startup includes
too many indirect (linked lists) datastructured, that allocated each
round. And that some datastructures are computed at execution time
(ExecTypeFromTL I'm looking at you). Unfortunately changing that is not
a small project.

Andres



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Vladimir Sitnikov
Дата:
Сообщение: Insert values() per-statement overhead
Следующее
От: Etsuro Fujita
Дата:
Сообщение: Re: Minor comment update in setrefs.c