Re: Do we really need to switch to per-tuple memory context inATRewriteTable() when Table Rewrite is not happening

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Do we really need to switch to per-tuple memory context inATRewriteTable() when Table Rewrite is not happening
Дата
Msg-id 20180103135535.otpmygpffiwnhqdi@alvherre.pgsql
обсуждение исходный текст
Ответ на Do we really need to switch to per-tuple memory context inATRewriteTable() when Table Rewrite is not happening  (Ashutosh Sharma <ashu.coek88@gmail.com>)
Ответы Re: Do we really need to switch to per-tuple memory context inATRewriteTable() when Table Rewrite is not happening
Список pgsql-hackers
Ashutosh Sharma wrote:

> I am basically talking about the following lines of code in
> ATRewriteTable() function.
> 
> /*
>  * Switch to per-tuple memory context and reset it for each tuple
>  * produced, so we don't leak memory.
>  */
> oldCxt = MemoryContextSwitchTo(GetPerTupleMemoryContext(estate));

Perhaps a memory context switch is so cheap that adding a branch to
verify whether it's needed is more expensive than just doing it all the
time.  You could prove me wrong by measuring it.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


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

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: [HACKERS] UPDATE of partition key
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Deadlock in multiple CIC.