# While query time and collector time bigger than request took time when profiling?

**URL:** <https://discuss.elastic.co/t/while-query-time-and-collector-time-bigger-than-request-took-time-when-profiling/164885>\
**Category:** Elasticsearch\
**Created:** [January 19, 2019, 8:06am UTC](https://discuss.elastic.co/t/while-query-time-and-collector-time-bigger-than-request-took-time-when-profiling/164885 "2019-01-19T08:06:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![saiergon](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@saiergon](https://discuss.elastic.co/u/saiergon)\
**Post date:** [January 19, 2019, 8:06am UTC](https://discuss.elastic.co/t/while-query-time-and-collector-time-bigger-than-request-took-time-when-profiling/164885/1 "2019-01-19T08:06:26Z")

</div>

the search is very simple

```auto
{
  "profile": true,
  "size": 0,
  "query": {
    "bool": {
      "must": [
        {
          "match": {
            "appid": "300047"
          }
        }
      ]
    }
  }
}

```

and the response is

```auto
"took" : 5,
  "timed_out" : false,
  "_shards" : {
    "total" : 64,
    "successful" : 64,
    "failed" : 0
  },
  "hits" : {
    "total" : 765081197,
    "max_score" : 0.0,
    "hits" : []
  },
  "profile" : {
    "shards" : [
      {
        "id" : "[pC6DBL4IQ6Ka3Rj-bAoA][xxx-20190118][15]",
        "searches" : [
          {
            "query" : [
              {
                "type" : "",
                "description" : "appid:[300047 TO 300047]",
                "time" : "324.4299370ms",
                "breakdown" : {
                  "score" : 0,
                  "build_scorer_count" : 1,
                  "match_count" : 0,
                  "create_weight" : 10594,
                  "next_doc" : 312452287,
                  "match" : 0,
                  "create_weight_count" : 1,
                  "next_doc_count" : 11949424,
                  "score_count" : 0,
                  "build_scorer" : 17630,
                  "advance" : 0,
                  "advance_count" : 0
                }
              }
            ],
            "rewrite_time" : 40843,
            "collector" : [
              {
                "name" : "CancellableCollector",
                "reason" : "search_cancelled",
                "time" : "870.9503310ms",
                "children" : [
                  {
                    "name" : "TotalHitCountCollector",
                    "reason" : "search_count",
                    "time" : "293.1619620ms"
                  }
                ]

```

so the request took 5ms, but query time spent 324.4ms and collector spent 878ms?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 19, 2019, 9:08am UTC](https://discuss.elastic.co/t/while-query-time-and-collector-time-bigger-than-request-took-time-when-profiling/164885/2 "2019-01-19T09:08:12Z")

</div>

Please don't post images of text as they are hardly readable and not searchable.

Instead paste the text and format it with `</>` icon. Check the preview window.

---

<div class="post-metadata">

**Author:** ![saiergon](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@saiergon](https://discuss.elastic.co/u/saiergon)\
**Post date:** [January 19, 2019, 9:24am UTC](https://discuss.elastic.co/t/while-query-time-and-collector-time-bigger-than-request-took-time-when-profiling/164885/3 "2019-01-19T09:24:44Z")

</div>

Changed

---

<div class="post-metadata">

**Author:** ![maxshortzp](https://avatars.discourse-cdn.com/v4/letter/m/ce73a5/32.png) [@maxshortzp](https://discuss.elastic.co/u/maxshortzp)\
**Post date:** [January 22, 2019, 11:44pm UTC](https://discuss.elastic.co/t/while-query-time-and-collector-time-bigger-than-request-took-time-when-profiling/164885/4 "2019-01-22T23:44:28Z")

</div>

I think this is the same thing as my question here: [https://github.com/elastic/elasticsearch/issues/33489](https://github.com/elastic/elasticsearch/issues/33489).

ES profiling uses sampling so the profile timings can be compared relative to each other but do not compare with the actual wall time in `took`.

---

<div class="post-metadata">

**Author:** ![saiergon](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@saiergon](https://discuss.elastic.co/u/saiergon)\
**Post date:** [January 23, 2019, 2:33am UTC](https://discuss.elastic.co/t/while-query-time-and-collector-time-bigger-than-request-took-time-when-profiling/164885/5 "2019-01-23T02:33:10Z")

</div>

got it , thank u.

---

<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 20, 2019, 2:33am UTC](https://discuss.elastic.co/t/while-query-time-and-collector-time-bigger-than-request-took-time-when-profiling/164885/6 "2019-02-20T02:33:14Z")

</div>

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