On 28/2/2024 13:53, Tender Wang wrote:
> The attached patch is a new version based on v3(not including Andrei's
> the test case). There is no need to call datumCopy when
> isnull is true.
>
> I have not added a new runtime memoryContext so far. Continue to use
> mstate->tableContext, I'm not sure the memory used of probeslot will
> affect mstate->mem_limit.
> Maybe adding a new memoryContext is better. I think I should spend a
> little time to learn nodeMemoize.c more deeply.
I am curious about your reasons to stay with tableContext. In terms of
memory allocation, Richard's approach looks better.
Also, You don't need to initialize tts_values[i] at all if tts_isnull[i]
set to true.
--
regards,
Andrei Lepikhov
Postgres Professional