# Poor performance with date range

**URL:** <https://discuss.elastic.co/t/poor-performance-with-date-range/24198>\
**Category:** Elasticsearch\
**Created:** [June 23, 2015, 2:27pm UTC](https://discuss.elastic.co/t/poor-performance-with-date-range/24198 "2015-06-23T14:27:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ton](https://avatars.discourse-cdn.com/v4/letter/t/e0b2c6/32.png) [@ton](https://discuss.elastic.co/u/ton)\
**Post date:** [June 23, 2015, 2:27pm UTC](https://discuss.elastic.co/t/poor-performance-with-date-range/24198/1 "2015-06-23T14:27:19Z")

</div>

i am getting very poor throughput when i adding date range filter,  
is there any tuning that i misssing ?

---

<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 23, 2015, 9:33pm UTC](https://discuss.elastic.co/t/poor-performance-with-date-range/24198/2 "2015-06-23T21:33:07Z")

</div>

It'd help if you gave us your query.

---

<div class="post-metadata">

**Author:** ![ton](https://avatars.discourse-cdn.com/v4/letter/t/e0b2c6/32.png) [@ton](https://discuss.elastic.co/u/ton)\
**Post date:** [June 24, 2015, 9:15am UTC](https://discuss.elastic.co/t/poor-performance-with-date-range/24198/3 "2015-06-24T09:15:35Z")

</div>

i see some improvment with rounding it to minute,  
is there anything else i can do to improve that query ?

{  
"from": 0,  
"size": 100,  
"query": {  
"filtered": {  
"query": {  
"match\_all": {}  
},  
"filter": {  
"bool": {  
"must": {"terms": {"TTTT": ["xxxx","yyyy","zzzz"]}},  
"should": [{"range": {"MYDATE": {"to": "now/m"}}},  
{"missing": {"field": "XXXX"}}  
],  
"must\_not":  
{"term": {"SSSSS": "C1"}},  
"must": {"terms": {"BBBBB": ["R1","R2"]}}  
}

```
    }
  }
}

```

}

---

<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 6, 2017, 12:05am UTC](https://discuss.elastic.co/t/poor-performance-with-date-range/24198/4 "2017-07-06T00:05:41Z")

</div>


