# Histogram Aggregation Performance issue on large dataset

**URL:** <https://discuss.elastic.co/t/histogram-aggregation-performance-issue-on-large-dataset/57789>\
**Category:** Elasticsearch\
**Created:** [August 11, 2016, 10:03am UTC](https://discuss.elastic.co/t/histogram-aggregation-performance-issue-on-large-dataset/57789 "2016-08-11T10:03:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hayder\_Abbass](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hayder_abbass/32/4559_2.png) [@Hayder\_Abbass](https://discuss.elastic.co/u/Hayder_Abbass)\
**Post date:** [August 11, 2016, 10:03am UTC](https://discuss.elastic.co/t/histogram-aggregation-performance-issue-on-large-dataset/57789/1 "2016-08-11T10:03:22Z")

</div>

Hello,

I have a quick question - How you guys handle working with histogram aggregation on very large datasets? When I display the same histogram on like \< 7 days there's no performance issue at all.

However, the larger the time range I set, the more time it takes to get the results. Is it a common practice to store aggregated result in MySQL when it has already been processed by ElasticSearch to improve performance?

**Update:**

1. We have a cluster of 3 nodes, 8 GB of RAM each.
2. We have a monthly index rotation with 45 million documents in each one.
3. 4 CPU Core for each node.

---

<div class="post-metadata">

**Author:** ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)\
**Post date:** [August 11, 2016, 10:57am UTC](https://discuss.elastic.co/t/histogram-aggregation-performance-issue-on-large-dataset/57789/2 "2016-08-11T10:57:43Z")

</div>

Could you give an example or a request you are running which you see this issue for? Also:

- What kind of response times are you seeing for this request?
- How many documents match your query (i.e. what is hits.total) ?
- What version of Elasticsearch are you using?
- How many documents are in the index(es) you are searching?

---

<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 5, 2017, 10:28pm UTC](https://discuss.elastic.co/t/histogram-aggregation-performance-issue-on-large-dataset/57789/3 "2017-07-05T22:28:27Z")

</div>


