# Memory Pressure Getting Very High Very Quickly Due to Potentially Expensive Query

**URL:** <https://discuss.elastic.co/t/memory-pressure-getting-very-high-very-quickly-due-to-potentially-expensive-query/341021>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-monitoring\
**Created:** [August 17, 2023, 1:34pm UTC](https://discuss.elastic.co/t/memory-pressure-getting-very-high-very-quickly-due-to-potentially-expensive-query/341021 "2023-08-17T13:34:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akaash\_Mukherjee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akaash_mukherjee/32/119513_2.png) [@Akaash\_Mukherjee](https://discuss.elastic.co/u/Akaash_Mukherjee)\
**Post date:** [August 17, 2023, 1:34pm UTC](https://discuss.elastic.co/t/memory-pressure-getting-very-high-very-quickly-due-to-potentially-expensive-query/341021/1 "2023-08-17T13:34:20Z")

</div>

Hi,

I'm running into a problem where memory pressure is getting very high very quickly when I make ES calls using a query with a lot of excludes. It seems to work fine for certain values of elastic\_tag\_subdomain but for others the JVM pressure explodes. My suspicion is that it's the query because I changed our basic query with the one below and the memory pressure problems started.

The query is below and there could be hundreds of properties in \_source.excludes

```auto
GET transactions/_search?filter_path=_scroll_id,hits.hits._source&scroll=1m&size=10
{
  "_source": {
    "excludes": ["attributes.a", "attributes.b", "attributes.c", "attributes.d", "attributes.e"]
  },
  "query": {
    "bool": {
      "filter": [
        {"term": {"elastic_tag_subdomain": "some_company"}},
        {"term": {"elastic_tag_module": "order"}},
        {"term": {"attributes.order_category": "Regular"}}
      ]
    }
  }
}

```

I'm wondering if this is normal or not and if anyone has ideas on how to handle this.

---

<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:** [September 14, 2023, 1:34pm UTC](https://discuss.elastic.co/t/memory-pressure-getting-very-high-very-quickly-due-to-potentially-expensive-query/341021/2 "2023-09-14T13:34:51Z")

</div>

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