# Debug Slow Query?

**URL:** <https://discuss.elastic.co/t/debug-slow-query/5361>\
**Category:** Elasticsearch\
**Created:** [September 12, 2011, 4:40pm UTC](https://discuss.elastic.co/t/debug-slow-query/5361 "2011-09-12T16:40:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![phobos182](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/phobos182/32/3011_2.png) [@phobos182](https://discuss.elastic.co/u/phobos182)\
**Post date:** [September 12, 2011, 4:40pm UTC](https://discuss.elastic.co/t/debug-slow-query/5361/1 "2011-09-12T16:40:32Z")

</div>

are there any options for debugging slow queries in ElasticSearch? I am having some queries take 3 seconds to repsond on 8 shards, and want to know where the slowdown is occurring.

Ex.

{  
took: 3972  
timed\_out: false  
\_shards: {  
total: 8  
successful: 8  
failed: 0  
}  
hits: {  
total: 589537  
max\_score: 119.84013  
...  
}

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [September 12, 2011, 11:45pm UTC](https://discuss.elastic.co/t/debug-slow-query/5361/2 "2011-09-12T23:45:43Z")

</div>

Can you gist your query / search request? One way, if you have a complex  
query / search request, is to trim down on the complexity and see what adds  
most to the time it takes.

On Mon, Sep 12, 2011 at 7:40 PM, phobos182 [phobos182@gmail.com](mailto:phobos182@gmail.com) wrote:

> are there any options for debugging slow queries in Elasticsearch? I am  
> having some queries take 3 seconds to repsond on 8 shards, and want to know  
> where the slowdown is occurring.
> 
> Ex.
> 
> {  
> took: 3972  
> timed\_out: false  
> \_shards: {  
> total: 8  
> successful: 8  
> failed: 0  
> }  
> hits: {  
> total: 589537  
> max\_score: 119.84013  
> ...  
> }
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/Debug-Slow-Query-tp3330170p3330170.html](http://elasticsearch-users.115913.n3.nabble.com/Debug-Slow-Query-tp3330170p3330170.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<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, 3:54am UTC](https://discuss.elastic.co/t/debug-slow-query/5361/3 "2017-07-06T03:54:38Z")

</div>


