# Cross indexes aggregations - should I worry?

**URL:** https://discuss.elastic.co/t/cross-indexes-aggregations-should-i-worry/61683
**Category:** Elasticsearch
**Created:** [September 28, 2016, 10:10am UTC](https://discuss.elastic.co/t/cross-indexes-aggregations-should-i-worry/61683 "2016-09-28T10:10:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![itaydvir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itaydvir/32/10143_2.png) [@itaydvir](https://discuss.elastic.co/u/itaydvir)
#### Post date: [September 28, 2016, 10:10am UTC](https://discuss.elastic.co/t/cross-indexes-aggregations-should-i-worry/61683/1 "2016-09-28T10:10:17Z")

</div>

Hello,

I'm writing an analytics system based on elasticsearch 2.3 and I'm trying to decide which approach to use: one index for all documents OR multi indexes (index per month).  
Since I'm doing aggregations on date range (max 6 months back) - I'm afraid It might have performance issues with cross indexes aggregations... I couldn't find an answer on the internet, so I decided to ask here.  
I'm expecting to have about 3M documents per month at the beginning.  
and I assume that most aggregations will have a date range of 2 months (will have to access 2 indexes in case of multi-index solution).

So, what would you do?

1. One index of ~90M documents + add deletion plugin for cleanups
2. Creating 12 indexes (easy monthly documents cleanup)

Thanks in advance

---

<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: [September 29, 2016, 11:44pm UTC](https://discuss.elastic.co/t/cross-indexes-aggregations-should-i-worry/61683/2 "2016-09-29T23:44:26Z")

</div>

I'd never, ever do 1. The cost in doing that delete-by is way too high if you can avoid it.  
Go with 2.

The cost of cross querying doesn't matter, take a look at the bottom of [this page](https://www.elastic.co/guide/en/elasticsearch/guide/current/multi-index-multi-type.html);

> Searching one index that has five primary shards is exactly equivalent to searching five indices that have one primary shard each.

---

<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:15pm UTC](https://discuss.elastic.co/t/cross-indexes-aggregations-should-i-worry/61683/3 "2017-07-05T22:15:59Z")

</div>


