Re: Why is it not sane to pass ExecStoreTuple(shouldFree=true) for tuples point into buffers
От | Tom Lane |
---|---|
Тема | Re: Why is it not sane to pass ExecStoreTuple(shouldFree=true) for tuples point into buffers |
Дата | |
Msg-id | 23133.1396964253@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Why is it not sane to pass ExecStoreTuple(shouldFree=true) for tuples point into buffers (Andres Freund <andres@2ndquadrant.com>) |
Ответы |
Re: Why is it not sane to pass
ExecStoreTuple(shouldFree=true) for tuples point into buffers
|
Список | pgsql-hackers |
Andres Freund <andres@2ndquadrant.com> writes: > On 2014-04-07 21:47:38 -0400, Tom Lane wrote: >> Well, that is certainly messy. I think you could just use a local >> HeapTupleData variable instead of palloc'ing every time, where "local" >> means "has lifespan similar to the slot pointer". >> There's some vaguely similar hacking near the end of ExecDelete. > Yea, and some other places. I wonder if a ExecShallowMaterializeSlot() > or something would be useful for me, that callsite and others? Don't like that name much, but I agree there's some room for a function like this. I guess you're imagining that we'd add a HeapTupleData field to TupleTableSlots, and use that for the workspace when this situation arises? An alternative possibility would be to not invent a new function, but just make ExecStoreTuple do this unconditionally when shouldFree=false. Not sure if there'd be a noticeable runtime penalty --- but the existing approach seems rather fragile. I know I've always thought of slots as being fully independent storage, and in this case they are not. regards, tom lane
В списке pgsql-hackers по дате отправления: