# Aggregation performance

**URL:** <https://discuss.elastic.co/t/aggregation-performance/276198>\
**Category:** Elasticsearch\
**Created:** [June 16, 2021, 9:02pm UTC](https://discuss.elastic.co/t/aggregation-performance/276198 "2021-06-16T21:02:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexs1](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@alexs1](https://discuss.elastic.co/u/alexs1)\
**Post date:** [June 16, 2021, 9:02pm UTC](https://discuss.elastic.co/t/aggregation-performance/276198/1 "2021-06-16T21:02:44Z")

</div>

hello,

Can anyone please advice how to improve a query performance?

- the bool filter takes 50ms.

- filter dates: last 7 days

- total search documents : 20075

- total index documents : 79m

- searched indices: 1

- index primary shard size: 9.2gb

- primary shards: 2

- replica:1

- storage tier: hot

thank you!

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/3/2392939b549e6f508b94fffeb9a3619a882dda9f.png)

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 17, 2021, 1:05am UTC](https://discuss.elastic.co/t/aggregation-performance/276198/2 "2021-06-17T01:05:59Z")

</div>

How much faster do you want it?

---

<div class="post-metadata">

**Author:** ![alexs1](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@alexs1](https://discuss.elastic.co/u/alexs1)\
**Post date:** [June 17, 2021, 5:23am UTC](https://discuss.elastic.co/t/aggregation-performance/276198/3 "2021-06-17T05:23:33Z")

</div>

Usually I'm used to much better performance.  
I'm trying to keep 2 seconds as target number

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 17, 2021, 5:38am UTC](https://discuss.elastic.co/t/aggregation-performance/276198/4 "2021-06-17T05:38:47Z")

</div>

If your index is only 9.2GB in size, why have 2 primary shards? What is the hardware specification of the cluster? What is the full output of the [cluster stats API](https://www.elastic.co/guide/en/elasticsearch/reference/7.13/cluster-stats.html)?

---

<div class="post-metadata">

**Author:** ![alexs1](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@alexs1](https://discuss.elastic.co/u/alexs1)\
**Post date:** [June 17, 2021, 6:39am UTC](https://discuss.elastic.co/t/aggregation-performance/276198/5 "2021-06-17T06:39:48Z")

</div>

I can decrease the shards via ilm, and do rollover..  
attached below, thanks!

[https://jsonblob.com/b6777ebd-cf36-11eb-a671-7b947ffb5d48](https://jsonblob.com/b6777ebd-cf36-11eb-a671-7b947ffb5d48)

---

<div class="post-metadata">

**Author:** ![alexs1](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@alexs1](https://discuss.elastic.co/u/alexs1)\
**Post date:** [June 18, 2021, 8:22am UTC](https://discuss.elastic.co/t/aggregation-performance/276198/6 "2021-06-18T08:22:45Z")

</div>

@Christian_Dahlqvist @warkolm any tips you can think of? Is 90 million too many documents per index?

---

<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 16, 2021, 8:22am UTC](https://discuss.elastic.co/t/aggregation-performance/276198/7 "2021-07-16T08:22:58Z")

</div>

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