Re: Tuplestore should remember the memory context it's created in

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Tuplestore should remember the memory context it's created in
Дата
Msg-id 18808.1261499463@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Tuplestore should remember the memory context it's created in  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Список pgsql-hackers
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> Tom Lane wrote:
>> I think it was just a performance optimization.  It's probably not
>> measurable though; even in the in-memory case there's at least a palloc
>> inside the put() function, no?

> Yes. And many of the callers do the memory context switching dance anyway.

Yeah, I was just noticing that.  We should go around and clean those up
if we apply this change.

Looking at the CVS history, I think the reason tuplestore doesn't do its
own memory context switch is that it was cloned from tuplesort, which
didn't either at the time.  But several years ago we changed tuplesort
to be safer about this (it actually keeps its own memory context now),
so it's just inconsistent that tuplestore still exposes the risk.

The ownership business is another story though.  tuplesort doesn't
make any attempt to defend itself against resource-owner changes.  If we
need this for tuplestore I bet we need it for tuplesort too; but do we?
        regards, tom lane


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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: alpha3 release schedule?
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: alpha3 release schedule?