# Fielddata for the \_parent field

**URL:** <https://discuss.elastic.co/t/fielddata-for-the-parent-field/128114>\
**Category:** Elasticsearch\
**Created:** [April 16, 2018, 7:33am UTC](https://discuss.elastic.co/t/fielddata-for-the-parent-field/128114 "2018-04-16T07:33:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lingerchouzi](https://avatars.discourse-cdn.com/v4/letter/l/f04885/32.png) [@lingerchouzi](https://discuss.elastic.co/u/lingerchouzi)\
**Post date:** [April 16, 2018, 7:33am UTC](https://discuss.elastic.co/t/fielddata-for-the-parent-field/128114/1 "2018-04-16T07:33:24Z")

</div>

The amount of heap used by fielddata can be checked by：  
\_stats/fielddata?fields=\*  
the response is:  
...  
"total": {  
"fielddata": {  
"memory\_size\_in\_bytes": 2592,  
"evictions": 0,  
"fields": {  
"\_parent": {  
"memory\_size\_in\_bytes": 1296  
},  
"\_parent#main\_type": {  
"memory\_size\_in\_bytes": 1296  
}  
}  
}  
}  
}  
I know parent/child in 5.x need global ordinals to speed up joins,but what confuse me is the relationship between \_parent#main\_type and \_parent. It seems that Fielddata was calculated twice。

BR  
zeqi

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [April 18, 2018, 6:44am UTC](https://discuss.elastic.co/t/fielddata-for-the-parent-field/128114/2 "2018-04-18T06:44:03Z")

</div>

these stats are per node, and you could have more than one parent/child mapping across your indices, so that `_parent` contains the size of all your ordinals, where as `parent#main_type` only contains the size of the ordinals for this specific type.

---

<div class="post-metadata">

**Author:** ![lingerchouzi](https://avatars.discourse-cdn.com/v4/letter/l/f04885/32.png) [@lingerchouzi](https://discuss.elastic.co/u/lingerchouzi)\
**Post date:** [April 18, 2018, 7:30am UTC](https://discuss.elastic.co/t/fielddata-for-the-parent-field/128114/3 "2018-04-18T07:30:04Z")

</div>

Thanks for your reply.I haven known that \_parent contains the all ordinals,but I still don't understand why the total memory usage is 2592.Does both \_parent and \_parent#main\_type require memory usage?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [April 18, 2018, 9:22am UTC](https://discuss.elastic.co/t/fielddata-for-the-parent-field/128114/4 "2018-04-18T09:22:36Z")

</div>

No, there is no doubled memory consumption. The number is only the same because you only have **one** parent/child field across all of your indices. If you had more indices using parent/child and those had different names, then you would have another counter for that field plus the summation of these fields in the `_parent` field.

hope that makes sense!

---

<div class="post-metadata">

**Author:** ![lingerchouzi](https://avatars.discourse-cdn.com/v4/letter/l/f04885/32.png) [@lingerchouzi](https://discuss.elastic.co/u/lingerchouzi)\
**Post date:** [April 18, 2018, 9:52am UTC](https://discuss.elastic.co/t/fielddata-for-the-parent-field/128114/5 "2018-04-18T09:52:01Z")

</div>

Thanks for your reply again. Now I use two indices using parent/child for testing,so it can be explain clearly. The response is:  
....  
"fielddata": {  
"memory\_size\_in\_bytes": 2144, // 2144=1072+424+648 //  
"evictions": 0,  
"fields": {  
"\_parent": {  
"memory\_size\_in\_bytes": 1072, //1072=424+648 //  
},  
"\_parent#main\_type\_2": {  
"memory\_size\_in\_bytes": 424  
},  
"\_parent#main\_type": {  
"memory\_size\_in\_bytes": 648  
....  
I know the \_parent is the summation of \_parent#main\_type\_2 and \_parent#main\_type. Although the total consumption statistics are 2144, the actual memory consumption is only 1072,is that right?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 16, 2018, 9:52am UTC](https://discuss.elastic.co/t/fielddata-for-the-parent-field/128114/6 "2018-05-16T09:52:05Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
