# Aggregations on multiple indices much slower than on single index

**URL:** https://discuss.elastic.co/t/aggregations-on-multiple-indices-much-slower-than-on-single-index/43228
**Category:** Elasticsearch
**Created:** [March 2, 2016, 10:32am UTC](https://discuss.elastic.co/t/aggregations-on-multiple-indices-much-slower-than-on-single-index/43228 "2016-03-02T10:32:37Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![rkrombho](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rkrombho/32/3574_2.png) [@rkrombho](https://discuss.elastic.co/u/rkrombho)
#### Post date: [March 2, 2016, 10:32am UTC](https://discuss.elastic.co/t/aggregations-on-multiple-indices-much-slower-than-on-single-index/43228/1 "2016-03-02T10:32:37Z")

</div>

Hi,

I noticed a huge performance decrease when it comes to aggregations on multiple indices compared to aggregations one index at a time.  
I got the following two indices:

- indexA ~ 1,250,000,000 docs (8 shards)
- indexB ~ 89,000,000 docs (4 shards)

My aggregation (which one doesnt really matter here) runs ~ 2100ms on indexA and ~1400ms on indexB.  
When I run the same aggregation on an Alias which points to both indices, it runs ~20000ms.  
I notices the same type of decrease for any type of aggregation I run (simple terms, cardinality etc).

Is this expected? Maybe due to the coordination work that needs to be done to merge those results together?

I mostly just split my indiced because it makes changes over time easier and because I didnt expect such a hit in terms of performance when querying multiple indices.

Should I try to put all my data into one big Index in order to avoid this kind of issues?

Another stange thing is, that I can not see any issues with regards to hot threads.  
There is no thread which e.g. runs the same thing for the complete 'interval'.

Cheers,  
Robert

---

<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, 11:12pm UTC](https://discuss.elastic.co/t/aggregations-on-multiple-indices-much-slower-than-on-single-index/43228/2 "2017-07-05T23:12:07Z")

</div>


