# Complex aggregations on multiple indices alias

**URL:** https://discuss.elastic.co/t/complex-aggregations-on-multiple-indices-alias/310912
**Category:** Elasticsearch
**Created:** [July 28, 2022, 4:51pm UTC](https://discuss.elastic.co/t/complex-aggregations-on-multiple-indices-alias/310912 "2022-07-28T16:51:03Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![shreedhan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shreedhan/32/46350_2.png) [@shreedhan](https://discuss.elastic.co/u/shreedhan)
#### Post date: [July 28, 2022, 4:51pm UTC](https://discuss.elastic.co/t/complex-aggregations-on-multiple-indices-alias/310912/1 "2022-07-28T16:51:03Z")

</div>

Hi,

If we create multiple indices under an alias and run query aggregations like stats aggregation, how does Elasticsearch compute metrics like Standard deviation? Will the accuracy of these types of metrics be lower than if all the data was on a single index?

Thanks,  
Shreedhan

---

<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: [August 9, 2022, 12:30am UTC](https://discuss.elastic.co/t/complex-aggregations-on-multiple-indices-alias/310912/2 "2022-08-09T00:30:59Z")

</div>

I don't know the details of how the stats aggs work, so I cannot comment there.

But most aggregations work on a shard level, and when you look at it that way there is no difference between an alias pointing to 5 indices with 1 shard each, and 1 index with 5 shards.

---

<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: [September 6, 2022, 12:31am UTC](https://discuss.elastic.co/t/complex-aggregations-on-multiple-indices-alias/310912/3 "2022-09-06T00:31:27Z")

</div>

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