# Performance when using \`time\_zone\` in date\_historgram

**URL:** <https://discuss.elastic.co/t/performance-when-using-time-zone-in-date-historgram/107949>\
**Category:** Elasticsearch\
**Created:** [November 16, 2017, 1:59pm UTC](https://discuss.elastic.co/t/performance-when-using-time-zone-in-date-historgram/107949 "2017-11-16T13:59:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![orweinberger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/orweinberger/32/580_2.png) [@orweinberger](https://discuss.elastic.co/u/orweinberger)\
**Post date:** [November 16, 2017, 1:59pm UTC](https://discuss.elastic.co/t/performance-when-using-time-zone-in-date-historgram/107949/1 "2017-11-16T13:59:30Z")

</div>

I'm experiencing some weird performance results in Elasticsearch 5.2.0.

I've been trying to debug why its taking so long to load the discover page in Kibana, the default query and aggregation (for the top bar chart) takes about 4 seconds when looking at the query statistics in Kibana.

If I copy the query and run it in the console, I can see the same results. This is the query:

```
POST index-2017.11.16/_search
{
  "size": 500,
  "sort": [
    {
      "@timestamp": {
        "order": "desc",
        "unmapped_type": "boolean"
      }
    }
  ],
  "query": {
    "bool": {
      "must": [
        {
          "query_string": {
            "analyze_wildcard": true,
            "query": "*"
          }
        },
        {
          "range": {
            "@timestamp": {
              "gte": 1510783200000,
              "lte": 1510869599999,
              "format": "epoch_millis"
            }
          }
        }
      ],
      "must_not": []
    }
  },
  "_source": {
    "excludes": []
  },
  "aggs": {
    "2": {
      "date_histogram": {
        "field": "@timestamp",
        "interval": "30m",
        "time_zone": "Asia/Amman",
        "min_doc_count": 1
      }
    }
  },
  "stored_fields": [
    "*"
  ],
  "script_fields": {},
  "docvalue_fields": []
}

```

However, if I remove the `time_zone` attribute from the date\_histogram, I get results back in 900ms. Is this a known issue? What causes this?

---

<div class="post-metadata">

**Author:** ![orweinberger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/orweinberger/32/580_2.png) [@orweinberger](https://discuss.elastic.co/u/orweinberger)\
**Post date:** [November 18, 2017, 8:10am UTC](https://discuss.elastic.co/t/performance-when-using-time-zone-in-date-historgram/107949/2 "2017-11-18T08:10:21Z")

</div>

Any ideas?

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [November 21, 2017, 2:29pm UTC](https://discuss.elastic.co/t/performance-when-using-time-zone-in-date-historgram/107949/3 "2017-11-21T14:29:38Z")

</div>

Unfortunately, this is expected: time zones make it hard to identify the right bucket, especially for time zones that implement daylight saving time.

---

<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:** [December 19, 2017, 2:29pm UTC](https://discuss.elastic.co/t/performance-when-using-time-zone-in-date-historgram/107949/4 "2017-12-19T14:29:44Z")

</div>

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