# Query Performance: Kibana generated query

**URL:** <https://discuss.elastic.co/t/query-performance-kibana-generated-query/17297>\
**Category:** Elasticsearch\
**Created:** [May 1, 2014, 12:26pm UTC](https://discuss.elastic.co/t/query-performance-kibana-generated-query/17297 "2014-05-01T12:26:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![biquotient](https://avatars.discourse-cdn.com/v4/letter/b/6a8cbe/32.png) [@biquotient](https://discuss.elastic.co/u/biquotient)\
**Post date:** [May 1, 2014, 12:26pm UTC](https://discuss.elastic.co/t/query-performance-kibana-generated-query/17297/1 "2014-05-01T12:26:50Z")

</div>

The following query takes between 15-20 seconds to  
run: [https://gist.github.com/ubethke/ddc311dc6036c582eff6](https://gist.github.com/ubethke/ddc311dc6036c582eff6)

I would expect this to run a lot quicker. Are there any issues with the  
query. Could it be written in a more efficient way?

Based on our setup below is this query performance for the type of query  
expected?

2 instances m3.2xlarge on EC2  
Index in question 2 shards and 1 replica  
Index in question 190M documents (mostly int,long,double data types)  
Index size 40 GB  
No custom routing  
55% of memory allocated to ES JVM

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d827f095-263a-46d8-a21a-62704ec810fc%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d827f095-263a-46d8-a21a-62704ec810fc%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:32am UTC](https://discuss.elastic.co/t/query-performance-kibana-generated-query/17297/2 "2017-07-06T01:32:19Z")

</div>


