# Performance comparisons of aggregations of fields in nested documents vs at root level?

**URL:** <https://discuss.elastic.co/t/performance-comparisons-of-aggregations-of-fields-in-nested-documents-vs-at-root-level/115173>\
**Category:** Elasticsearch\
**Created:** [January 11, 2018, 9:03pm UTC](https://discuss.elastic.co/t/performance-comparisons-of-aggregations-of-fields-in-nested-documents-vs-at-root-level/115173 "2018-01-11T21:03:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Devgruel](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@Devgruel](https://discuss.elastic.co/u/Devgruel)\
**Post date:** [January 11, 2018, 9:03pm UTC](https://discuss.elastic.co/t/performance-comparisons-of-aggregations-of-fields-in-nested-documents-vs-at-root-level/115173/1 "2018-01-11T21:03:55Z")

</div>

I am interested in letting users perform aggregations on an arbitrary time range of past data. These aggregations will include averages, percentiles, and terms aggregations with multiple sub-aggregation-levels. The data is structured in a parent-child one-to-many relationship.

Performance-wise for aggregation queries, are there any downsides of using nested documents within a related parent doc compared to duplicating the parent doc fields and having a separate Elasticsearch document per child?

---

<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:** [February 8, 2018, 9:04pm UTC](https://discuss.elastic.co/t/performance-comparisons-of-aggregations-of-fields-in-nested-documents-vs-at-root-level/115173/2 "2018-02-08T21:04:07Z")

</div>

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