Re: Question about tuplestore clients
От
Tom Lane
Тема
Re: Question about tuplestore clients
Дата
Msg-id
15297.1174411430@sss.pgh.pa.us
Ответ на
Question about tuplestore clients (Gregory Stark)
Список
Дерево обсуждения
Question about tuplestore clients Gregory Stark <stark@enterprisedb.com>
Re: Question about tuplestore clients Tom Lane <tgl@sss.pgh.pa.us>
Gregory Stark writes:
> However I've run into something I didn't expect. It seems merge joins keep a
> reference to a tuple *after* they set the mark beyond it. I'm trying to figure
> out why this is necessary but I haven't absorbed all of nodeMergejoin yet.
I think at the instant that ExecMarkPos is called, there are likely to
still be tuple slots holding references to the previously marked tuple.
It might work if you swap the two lines
ExecMarkPos(innerPlan);
MarkInnerTuple(node->mj_InnerTupleSlot, node);
However, the whole thing sounds a bit fragile. If tuplestore_gettuple
returns a tuple with shouldfree = false, I think you had better assume
that that tuple can be referenced until after the next
tuplestore_gettuple call, independently of mark/restore calls.
regards, tom lane
В списке pgsql-hackers по дате отправления
От: Martijn van Oosterhout
Дата: