Re: Tuplestore should remember the memory context it's created in - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Tuplestore should remember the memory context it's created in
Date
Msg-id 4B30F024.2070808@enterprisedb.com
Whole thread Raw
In response to Re: Tuplestore should remember the memory context it's created in  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Tuplestore should remember the memory context it's created in  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Greg Stark <gsstark@mit.edu> writes:
>> On Tue, Dec 22, 2009 at 11:45 AM, Heikki Linnakangas
>> <heikki.linnakangas@enterprisedb.com> wrote:
>>> AFAICS it is always a bug to be in a different memory context
>>> in tuplestore_put* than in tuplestore_begin_heap(), so it would be more
>>> robust to not put the burden on the callers.
> 
>> I thought there were comments specifically explaining why it was done
>> that way but I don't recall what they said.
> 
> 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.

--  Heikki Linnakangas EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: alpha3 release schedule?
Next
From: Simon Riggs
Date:
Subject: Re: alpha3 release schedule?