# What happens to unampped fields? What are the performance disadvantage of not mapping a field?

**URL:** <https://discuss.elastic.co/t/what-happens-to-unampped-fields-what-are-the-performance-disadvantage-of-not-mapping-a-field/281746>\
**Category:** Elasticsearch\
**Created:** [August 17, 2021, 7:59pm UTC](https://discuss.elastic.co/t/what-happens-to-unampped-fields-what-are-the-performance-disadvantage-of-not-mapping-a-field/281746 "2021-08-17T19:59:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vaibhav\_Singal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vaibhav_singal/32/93306_2.png) [@Vaibhav\_Singal](https://discuss.elastic.co/u/Vaibhav_Singal)\
**Post date:** [August 17, 2021, 7:59pm UTC](https://discuss.elastic.co/t/what-happens-to-unampped-fields-what-are-the-performance-disadvantage-of-not-mapping-a-field/281746/1 "2021-08-17T19:59:01Z")

</div>

I have an index with dynamic mapping set to **false**.

```auto
PUT index_a
{
  "mappings": {
    "_doc": {
      "dynamic": false, 
      "properties": {
        "_doc": { 
          "properties": {
            "id": {
              "type": "keyword"
            },
            "date": { 
              "type": "keyword"
            }
          }
        }
      }
    }
  }
}

```

My document looks like following -

```auto
{
  "id": "1",
  "date": "2020-01-01",
  "value": 1
}

```

I perform queries on this index, by applying filters on indexed fields and fetching the whole document -

```auto
GET index_a/_search
{
  "query": {
    "bool": {
      "filter": [
        {
          "term": {
            "id": "1"
          }
        },
        {
          "term": {
            "date": "2020-01-01"
          }
        }
      ]
    }
  }
}

```

Should having "value" as an unmapped field bear any performance impact?  
Are these fields stored as doc\_values?

I noticed that earlier when I used to index this field, my query performance was better and had less load on cluster. But after disabling dynamic mapping, and making it an unmapped field the cluster metrics degraded.  
The query is still fast, but with poor cluster metrics.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 17, 2021, 9:59pm UTC](https://discuss.elastic.co/t/what-happens-to-unampped-fields-what-are-the-performance-disadvantage-of-not-mapping-a-field/281746/2 "2021-08-17T21:59:37Z")

</div>

From [the docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/dynamic-field-mapping.html);

> Setting the `dynamic` parameter to `false` ignores new fields

So it won't do much except at indexing time as it processes it.

---

<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, 2021, 9:59pm UTC](https://discuss.elastic.co/t/what-happens-to-unampped-fields-what-are-the-performance-disadvantage-of-not-mapping-a-field/281746/3 "2021-09-14T21:59:52Z")

</div>

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