Re: why doesn't DestroyPartitionDirectory hash_destroy? - Mailing list pgsql-hackers

From Amit Langote
Subject Re: why doesn't DestroyPartitionDirectory hash_destroy?
Date
Msg-id e7bcef25-317b-75fc-cc63-34e1fbec514b@lab.ntt.co.jp
Whole thread Raw
In response to Re: why doesn't DestroyPartitionDirectory hash_destroy?  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Responses Re: why doesn't DestroyPartitionDirectory hash_destroy?  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
List pgsql-hackers
On 2019/03/14 16:46, Amit Langote wrote:
> On 2019/03/14 16:32, Kyotaro HORIGUCHI wrote:
>> At Thu, 14 Mar 2019 16:13:23 +0900, Amit Langote <Langote_Amit_f8@lab.ntt.co.jp> wrote in
<3ad792cd-0805-858e-595c-c09e9d1ce042@lab.ntt.co.jp>
>>> Hi,
>>>
>>> I'm curious why DestroyPartitionDirectory doesn't do
>>> hash_destroy(pdir->pdir_hash)?
>>
>> Maybe it is trashed involved in destruction of es_query_cxt or
>> planner_cxt?
> 
> Hmm, the executor's partition directory (its hash table) is indeed
> allocated under es_query_cxt.  But, the planner's partition directory is
> not allocated under planner_cxt, it appears to be using memory under
> MessageContext.

I forgot to mention that it would be wrong to put it under planner_cxt, as
it's the context for planning a given subquery, whereas a partition
directory is maintained throughout the whole planning.

Thanks,
Amit




pgsql-hackers by date:

Previous
From: Pavan Deolasee
Date:
Subject: Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits
Next
From: Dean Rasheed
Date:
Subject: Re: pgsql: Add support for hyperbolic functions, as well as log10().