# Range filter performance consideration

**URL:** <https://discuss.elastic.co/t/range-filter-performance-consideration/26695>\
**Category:** Elasticsearch\
**Created:** [August 2, 2015, 11:53pm UTC](https://discuss.elastic.co/t/range-filter-performance-consideration/26695 "2015-08-02T23:53:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![limac](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/limac/32/3981_2.png) [@limac](https://discuss.elastic.co/u/limac)\
**Post date:** [August 2, 2015, 11:53pm UTC](https://discuss.elastic.co/t/range-filter-performance-consideration/26695/1 "2015-08-02T23:53:04Z")

</div>

Hi, I am currently make a lot of range filter in this way:

"filter":{  
"range":{"date":{"gte":1438358400, "lte":1438358460}}  
}

if we disable cache, does elasticsearch will scan every doc in my index to determine if it falls into the range in this filter?

---

<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 3, 2015, 12:19am UTC](https://discuss.elastic.co/t/range-filter-performance-consideration/26695/2 "2015-08-03T00:19:06Z")

</div>

That is correct.

---

<div class="post-metadata">

**Author:** ![limac](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/limac/32/3981_2.png) [@limac](https://discuss.elastic.co/u/limac)\
**Post date:** [August 3, 2015, 12:26am UTC](https://discuss.elastic.co/t/range-filter-performance-consideration/26695/3 "2015-08-03T00:26:12Z")

</div>

Oh, that's really not a good news for me. Because I have daily indices of 250GB each and I also make a lot of range filter, most of the range are just less then 100 seconds. That means every docs in some index will be read again and again!  
in sql database, I know I can setup some field be ordered and no need for full scan for query in my senario. Is there any way for elasticsearch to do in some way like this?

---

<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:57pm UTC](https://discuss.elastic.co/t/range-filter-performance-consideration/26695/4 "2017-07-05T23:57:49Z")

</div>


