# Long Duration IndexOrDocValuesQuery

**URL:** <https://discuss.elastic.co/t/long-duration-indexordocvaluesquery/164022>\
**Category:** Elasticsearch\
**Created:** [January 13, 2019, 7:33am UTC](https://discuss.elastic.co/t/long-duration-indexordocvaluesquery/164022 "2019-01-13T07:33:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wakawaka54](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wakawaka54/32/39728_2.png) [@wakawaka54](https://discuss.elastic.co/u/wakawaka54)\
**Post date:** [January 13, 2019, 7:33am UTC](https://discuss.elastic.co/t/long-duration-indexordocvaluesquery/164022/1 "2019-01-13T07:33:50Z")

</div>

Hey guys!

I am using a 5 node elasticsearch cluster with a ~120GB index.

We are having issues with slow queries that have several filters. After profiling our queries, I see that `IndexOrDocValuesQuery` is taking about 3.2 seconds each. Each query has about 4 or 5 of these steps which cause it to take 20 seconds. What is weird is that the TermQuery which I would imagine is much more expensive takes 64 ms.

Where should we poke around to get more information as to what could be slowing these queries down?

Node Specs:  
4 CPUs  
26 GB RAM  
12 GB Heap

5 Data Nodes, 2 Masters, 2 Clients. Masters and clients are much lower speced than nodes.

Here is the query: [https://gist.github.com/wakawaka54/d4cad864d858efc41a0b2806ea0041b4](https://gist.github.com/wakawaka54/d4cad864d858efc41a0b2806ea0041b4)

Here is the query profile result: [https://gist.github.com/wakawaka54/6b52fd0eef2b8ead1589241e65c239fe](https://gist.github.com/wakawaka54/6b52fd0eef2b8ead1589241e65c239fe)

---

<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:** [February 10, 2019, 7:34am UTC](https://discuss.elastic.co/t/long-duration-indexordocvaluesquery/164022/2 "2019-02-10T07:34:03Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
