# Question about performance of has\_child filter

**URL:** <https://discuss.elastic.co/t/question-about-performance-of-has-child-filter/15308>\
**Category:** Elasticsearch\
**Created:** [January 18, 2014, 12:29pm UTC](https://discuss.elastic.co/t/question-about-performance-of-has-child-filter/15308 "2014-01-18T12:29:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Josh\_F](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/josh_f/32/1863_2.png) [@Josh\_F](https://discuss.elastic.co/u/Josh_F)\
**Post date:** [January 18, 2014, 12:29pm UTC](https://discuss.elastic.co/t/question-about-performance-of-has-child-filter/15308/1 "2014-01-18T12:29:09Z")

</div>

Hey all,

I am running a 5 node ES cluster (version 0.90.4) and recently experienced  
an OutOfMemory issue where all nodes simultaneously went out of memory.  
I am wondering if this could be related to my use of the has\_child filter.

I have two document types: 'Item' and 'ItemInList'. There is a parent child  
relationship here, ItemInList is a child of Item. Any item can be in  
several lists.  
There are around 300,000 Item documents at 21 million ItemInList documents.

I frequently execute a has\_child filter (maybe around 200-400 per minute),  
to retrieve a list (i.e. get all the items which have an ItemInList child  
which contains a given listId)

in Java this looks like: FilterBuilders.hasChildFilter("ItemInList",  
FilterBuilders.termFilter("ListId", listId));

Are there any known performance issues with doing this? Is the has\_child  
filter cached by default? Does anyone have any tips to prevent out of  
memory issues with these type of queries?

Thanks for any advice,  
Josh

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e3c01918-de5a-4525-b4a3-a56cde670835%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e3c01918-de5a-4525-b4a3-a56cde670835%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 18, 2014, 1:36pm UTC](https://discuss.elastic.co/t/question-about-performance-of-has-child-filter/15308/2 "2014-01-18T13:36:03Z")

</div>

As far as I remember, some memory improvements have been done since.  
I would suggest to upgrade to 0.90.10.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 18 janv. 2014 à 13:29, Josh F [jofo90@gmail.com](mailto:jofo90@gmail.com) a écrit :

Hey all,

I am running a 5 node ES cluster (version 0.90.4) and recently experienced an OutOfMemory issue where all nodes simultaneously went out of memory.  
I am wondering if this could be related to my use of the has\_child filter.

I have two document types: 'Item' and 'ItemInList'. There is a parent child relationship here, ItemInList is a child of Item. Any item can be in several lists.  
There are around 300,000 Item documents at 21 million ItemInList documents.

I frequently execute a has\_child filter (maybe around 200-400 per minute), to retrieve a list (i.e. get all the items which have an ItemInList child which contains a given listId)

in Java this looks like: FilterBuilders.hasChildFilter("ItemInList",  
FilterBuilders.termFilter("ListId", listId));

Are there any known performance issues with doing this? Is the has\_child filter cached by default? Does anyone have any tips to prevent out of memory issues with these type of queries?

Thanks for any advice,  
Josh

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e3c01918-de5a-4525-b4a3-a56cde670835%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e3c01918-de5a-4525-b4a3-a56cde670835%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/5F8B6362-D300-4B96-A87A-35B24324B248%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/5F8B6362-D300-4B96-A87A-35B24324B248%40pilato.fr).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Josh\_F](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/josh_f/32/1863_2.png) [@Josh\_F](https://discuss.elastic.co/u/Josh_F)\
**Post date:** [January 18, 2014, 5:06pm UTC](https://discuss.elastic.co/t/question-about-performance-of-has-child-filter/15308/3 "2014-01-18T17:06:13Z")

</div>

I will upgrade, I didn't really see anything relating to this in the  
release notes, though - except possibly this one:

> <https://github.com/elastic/elasticsearch/issues/4592>
>
> We should add a circuit breaker to prevent Elasticsearch from running out of mem…ory when field data is loaded.

Thanks

On Saturday, January 18, 2014 1:36:03 PM UTC, David Pilato wrote:

> As far as I remember, some memory improvements have been done since.  
> I would suggest to upgrade to 0.90.10.
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 18 janv. 2014 à 13:29, Josh F \<[jof...@gmail.com](mailto:jof...@gmail.com) \<javascript:\>\> a  
> écrit :
> 
> Hey all,
> 
> I am running a 5 node ES cluster (version 0.90.4) and recently experienced  
> an OutOfMemory issue where all nodes simultaneously went out of memory.  
> I am wondering if this could be related to my use of the has\_child filter.
> 
> I have two document types: 'Item' and 'ItemInList'. There is a parent  
> child relationship here, ItemInList is a child of Item. Any item can be in  
> several lists.  
> There are around 300,000 Item documents at 21 million ItemInList documents.
> 
> I frequently execute a has\_child filter (maybe around 200-400 per minute),  
> to retrieve a list (i.e. get all the items which have an ItemInList child  
> which contains a given listId)
> 
> in Java this looks like: FilterBuilders.hasChildFilter("ItemInList",  
> FilterBuilders.termFilter("ListId", listId));
> 
> Are there any known performance issues with doing this? Is the has\_child  
> filter cached by default? Does anyone have any tips to prevent out of  
> memory issues with these type of queries?
> 
> Thanks for any advice,  
> Josh
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/e3c01918-de5a-4525-b4a3-a56cde670835%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e3c01918-de5a-4525-b4a3-a56cde670835%40googlegroups.com)  
> .  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/2361be06-81dd-4b36-88a9-9e751cc91b19%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2361be06-81dd-4b36-88a9-9e751cc91b19%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [July 6, 2017, 1:56am UTC](https://discuss.elastic.co/t/question-about-performance-of-has-child-filter/15308/4 "2017-07-06T01:56:01Z")

</div>

Closed on July 6, 2017, 1:56am UTC


