# Elasticsearch Aggregation Internal

**URL:** <https://discuss.elastic.co/t/elasticsearch-aggregation-internal/91770>\
**Category:** Elasticsearch\
**Created:** [July 4, 2017, 12:19pm UTC](https://discuss.elastic.co/t/elasticsearch-aggregation-internal/91770 "2017-07-04T12:19:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![avitash](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/avitash/32/10346_2.png) [@avitash](https://discuss.elastic.co/u/avitash)\
**Post date:** [July 4, 2017, 12:19pm UTC](https://discuss.elastic.co/t/elasticsearch-aggregation-internal/91770/1 "2017-07-04T12:19:22Z")

</div>

We have 6.8 million data in an index with only single shard. We found that a simple sum query on a filed just takes few milliseconds.  
To have a confidence on going forward with elasticsearch cluster we wanted to confirm the technique used to perform such aggregation on the fly.

Our postulate is : when a document is getting ingested into the index, the metrices like count, sum, average are pre-calculated for each field value and stored as a part of the index entry itself.

Please clarify if our assumption is wrong.  
In that case please suggest on what parameters we decide our capacity planning for aggregations.

I tried to search for similar answers but could not find any satisfactory answers. Some links might also be helpful.

---

<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:** [August 1, 2017, 12:19pm UTC](https://discuss.elastic.co/t/elasticsearch-aggregation-internal/91770/2 "2017-08-01T12:19:48Z")

</div>

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