Re: why doesn't DestroyPartitionDirectory hash_destroy?

2019-03-17 Thread Amit Langote
On 2019/03/15 2:56, Robert Haas wrote: > On Thu, Mar 14, 2019 at 1:16 PM Tom Lane wrote: >> Actually, now that I've absorbed a bit more about 898e5e329, >> I don't like very much about it at all. I think having it >> try to hang onto pointers into the relcache is a completely >> wrongheaded desig

Re: why doesn't DestroyPartitionDirectory hash_destroy?

2019-03-17 Thread Amit Langote
On 2019/03/15 1:02, Robert Haas wrote: > On Thu, Mar 14, 2019 at 3:13 AM Amit Langote > wrote: >> I'm curious why DestroyPartitionDirectory doesn't do >> hash_destroy(pdir->pdir_hash)? > > What would be the point? It's more efficient to let context teardown > take care of it. Yeah, I only notic

Re: why doesn't DestroyPartitionDirectory hash_destroy?

2019-03-14 Thread Robert Haas
On Thu, Mar 14, 2019 at 1:40 PM Tom Lane wrote: > So here's my problem with that argument: you're effectively saying that > you needn't write any API spec for the PartitionDirectory functions > because you intend that every person calling them will read their code, > carefully and fully, before us

Re: why doesn't DestroyPartitionDirectory hash_destroy?

2019-03-14 Thread Robert Haas
On Thu, Mar 14, 2019 at 1:16 PM Tom Lane wrote: > Actually, now that I've absorbed a bit more about 898e5e329, > I don't like very much about it at all. I think having it > try to hang onto pointers into the relcache is a completely > wrongheaded design decision, and the right way for it to work

Re: why doesn't DestroyPartitionDirectory hash_destroy?

2019-03-14 Thread Tom Lane
Robert Haas writes: > On Thu, Mar 14, 2019 at 12:56 PM Tom Lane wrote: >> It's completely not acceptable that every reader of this code should >> have to reverse-engineer these design assumptions, especially given >> how shaky they are. > Well, one reason is that everything you just said is basi

Re: why doesn't DestroyPartitionDirectory hash_destroy?

2019-03-14 Thread Robert Haas
On Thu, Mar 14, 2019 at 12:56 PM Tom Lane wrote: > Agreed, but the comments in this area are crap. Why doesn't > CreatePartitionDirectory say something like > > * The object lives inside the given memory context and will be > * freed when that context is destroyed. Nonetheless, the caller > *

Re: why doesn't DestroyPartitionDirectory hash_destroy?

2019-03-14 Thread Tom Lane
I wrote: > Agreed, but the comments in this area are crap. Actually, now that I've absorbed a bit more about 898e5e329, I don't like very much about it at all. I think having it try to hang onto pointers into the relcache is a completely wrongheaded design decision, and the right way for it to wo

Re: why doesn't DestroyPartitionDirectory hash_destroy?

2019-03-14 Thread Tom Lane
Robert Haas writes: > On Thu, Mar 14, 2019 at 3:13 AM Amit Langote > wrote: >> I'm curious why DestroyPartitionDirectory doesn't do >> hash_destroy(pdir->pdir_hash)? > What would be the point? It's more efficient to let context teardown > take care of it. Agreed, but the comments in this area

Re: why doesn't DestroyPartitionDirectory hash_destroy?

2019-03-14 Thread Robert Haas
On Thu, Mar 14, 2019 at 3:13 AM Amit Langote wrote: > I'm curious why DestroyPartitionDirectory doesn't do > hash_destroy(pdir->pdir_hash)? What would be the point? It's more efficient to let context teardown take care of it. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterpr

Re: why doesn't DestroyPartitionDirectory hash_destroy?

2019-03-14 Thread Kyotaro HORIGUCHI
At Thu, 14 Mar 2019 17:18:29 +0900, Amit Langote wrote in > 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 > >> wrote in > >> <3ad792cd-0805-858e-595c-c09e9d1ce...@lab.ntt.co.jp> > >>> Hi, > >>>

Re: why doesn't DestroyPartitionDirectory hash_destroy?

2019-03-14 Thread Amit Langote
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 >> wrote in >> <3ad792cd-0805-858e-595c-c09e9d1ce...@lab.ntt.co.jp> >>> Hi, >>> >>> I'm curious why DestroyPartitionDirectory doesn't do >>> hash_destroy(p

Re: why doesn't DestroyPartitionDirectory hash_destroy?

2019-03-14 Thread Amit Langote
On 2019/03/14 16:32, Kyotaro HORIGUCHI wrote: > At Thu, 14 Mar 2019 16:13:23 +0900, Amit Langote > wrote in > <3ad792cd-0805-858e-595c-c09e9d1ce...@lab.ntt.co.jp> >> Hi, >> >> I'm curious why DestroyPartitionDirectory doesn't do >> hash_destroy(pdir->pdir_hash)? > > Maybe it is trashed involved

Re: why doesn't DestroyPartitionDirectory hash_destroy?

2019-03-14 Thread Kyotaro HORIGUCHI
At Thu, 14 Mar 2019 16:13:23 +0900, Amit Langote wrote in <3ad792cd-0805-858e-595c-c09e9d1ce...@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? -- Kyotar

why doesn't DestroyPartitionDirectory hash_destroy?

2019-03-14 Thread Amit Langote
Hi, I'm curious why DestroyPartitionDirectory doesn't do hash_destroy(pdir->pdir_hash)? Thanks, Amit