# Performance questions

**URL:** <https://discuss.elastic.co/t/performance-questions/11688>\
**Category:** Elasticsearch\
**Created:** [April 24, 2013, 9:03pm UTC](https://discuss.elastic.co/t/performance-questions/11688 "2013-04-24T21:03:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Valentin\_Pletzer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/valentin_pletzer/32/105548_2.png) [@Valentin\_Pletzer](https://discuss.elastic.co/u/Valentin_Pletzer)\
**Post date:** [April 24, 2013, 9:03pm UTC](https://discuss.elastic.co/t/performance-questions/11688/1 "2013-04-24T21:03:23Z")

</div>

After reading this blog-post [http://euphonious-intuition.com/2013/02/five-things-i-learned-from-elasticsearch-training/](http://euphonious-intuition.com/2013/02/five-things-i-learned-from-elasticsearch-training/) I have two questions, I hope someone can answer.

1. when using match all and several filter (no query) is the bool filter still faster?
2. one filter of mine selects all data of today with gte: "now/d" would setting an upper and lower timestamp increase the performance?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![taras](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/taras/32/507_2.png) [@taras](https://discuss.elastic.co/u/taras)\
**Post date:** [April 24, 2013, 9:33pm UTC](https://discuss.elastic.co/t/performance-questions/11688/2 "2013-04-24T21:33:58Z")

</div>

1. If you are doing term and a range filter you're better off with Bool. If  
you're doing a range filter and a geo filter and a query filter you could  
see slightly better performance with an And. When in doubt, use bool.
2. If "now/d" is day granularity instead of being down to the second, then  
having a single gte is a little faster. The point of the optimization is to  
build the filter so that it stays the same over multiple invocations. Under  
some circumstances you may also benefit from chaining range filters inside  
of a Bool filter. For example, you may filter our documents for \*last 7 days

- then apply a _last hour_ filter. That approach _will_ yield better  
results for very large dataset if you expect to run the same query and just  
page backwards one hour at a time. But if your dataset is relatively small,  
having an intermediate range filter will slow down your query a little.

On Wednesday, April 24, 2013 2:03:23 PM UTC-7, Valentin wrote:

> After reading this blog-post  
> [http://euphonious-intuition.com/2013/02/five-things-i-learned-from-elasticsearch-training/I](http://euphonious-intuition.com/2013/02/five-things-i-learned-from-elasticsearch-training/I) have two questions, I hope someone can answer.
> 
> 1. when using match all and several filter (no query) is the bool filter  
> still faster?
> 2. one filter of mine selects all data of today with gte: "now/d" would  
> setting an upper and lower timestamp increase the performance?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Valentin\_Pletzer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/valentin_pletzer/32/105548_2.png) [@Valentin\_Pletzer](https://discuss.elastic.co/u/Valentin_Pletzer)\
**Post date:** [April 25, 2013, 12:54pm UTC](https://discuss.elastic.co/t/performance-questions/11688/3 "2013-04-25T12:54:47Z")

</div>

Thanks. That info actually helps a lot!

On Wednesday, April 24, 2013 11:33:58 PM UTC+2, Taras Shkvarchuk wrote:

> 1. If you are doing term and a range filter you're better off with Bool.  
> If you're doing a range filter and a geo filter and a query filter you  
> could see slightly better performance with an And. When in doubt, use bool.
> 2. If "now/d" is day granularity instead of being down to the second, then  
> having a single gte is a little faster. The point of the optimization is to  
> build the filter so that it stays the same over multiple invocations. Under  
> some circumstances you may also benefit from chaining range filters inside  
> of a Bool filter. For example, you may filter our documents for _last 7  
> days_ then apply a _last hour_ filter. That approach _will_ yield better  
> results for very large dataset if you expect to run the same query and just  
> page backwards one hour at a time. But if your dataset is relatively small,  
> having an intermediate range filter will slow down your query a little.
> 
> On Wednesday, April 24, 2013 2:03:23 PM UTC-7, Valentin wrote:
> 
> > After reading this blog-post  
> > [http://euphonious-intuition.com/2013/02/five-things-i-learned-from-elasticsearch-training/I](http://euphonious-intuition.com/2013/02/five-things-i-learned-from-elasticsearch-training/I) have two questions, I hope someone can answer.
> > 
> > 1. when using match all and several filter (no query) is the bool filter  
> > still faster?
> > 2. one filter of mine selects all data of today with gte: "now/d" would  
> > setting an upper and lower timestamp increase the performance?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:39am UTC](https://discuss.elastic.co/t/performance-questions/11688/4 "2017-07-06T02:39:38Z")

</div>


