# Is this right? Nested array will slow down deep search

**URL:** <https://discuss.elastic.co/t/is-this-right-nested-array-will-slow-down-deep-search/126464>\
**Category:** Elasticsearch\
**Created:** [April 2, 2018, 8:22pm UTC](https://discuss.elastic.co/t/is-this-right-nested-array-will-slow-down-deep-search/126464 "2018-04-02T20:22:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![frzhang](https://avatars.discourse-cdn.com/v4/letter/f/d6d6ee/32.png) [@frzhang](https://discuss.elastic.co/u/frzhang)\
**Post date:** [April 2, 2018, 8:22pm UTC](https://discuss.elastic.co/t/is-this-right-nested-array-will-slow-down-deep-search/126464/1 "2018-04-02T20:22:06Z")

</div>

Initially, there was a nested array in my document but I didn't search any field in the array, when I profiled the \_search, I found out there were children query on the nested array (something like below, it has such TermQuery on all elements in the nested array). entries is a nested array in the document.

```auto
            {
              "type": "TermQuery",
              "description": "_type:__entries",
              "time": "52.51162800ms",
              "time_in_nanos": 52511628,
              "breakdown": {
                "score": 0,
                "build_scorer_count": 1,
                "match_count": 0,
                "create_weight": 440,
                "next_doc": 0,
                "match": 0,
                "create_weight_count": 1,
                "next_doc_count": 0,
                "score_count": 0,
                "build_scorer": 6986,
                "advance": 52402089,
                "advance_count": 102111
              }
            },

```

And for test purpose, I turned off the nested array in the document, I haven't really benchmarked the before and the after yet, but I hardly see any time out from my search any more afterwards.

Here are my questions:

1. Even the query term is not against the nested array, it will slow down the query dramatically, is this true?
2. If the 1 is true, if it's possible to stop querying the nested array in this case?

Thanks,  
Frank

---

<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:** [April 30, 2018, 8:36pm UTC](https://discuss.elastic.co/t/is-this-right-nested-array-will-slow-down-deep-search/126464/2 "2018-04-30T20:36:13Z")

</div>

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