# Field name length and ElasticSearch performance

**URL:** <https://discuss.elastic.co/t/field-name-length-and-elasticsearch-performance/6645>\
**Category:** Elasticsearch\
**Created:** [February 8, 2012, 6:36pm UTC](https://discuss.elastic.co/t/field-name-length-and-elasticsearch-performance/6645 "2012-02-08T18:36:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andym](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@andym](https://discuss.elastic.co/u/andym)\
**Post date:** [February 8, 2012, 6:36pm UTC](https://discuss.elastic.co/t/field-name-length-and-elasticsearch-performance/6645/1 "2012-02-08T18:36:06Z")

</div>

Hi,

Will the size of the elastic search index decrease (and performance  
increase due to reduce memory footprint) if I were to shorten field  
names?

I have many fields in index which have descriptive names (i.e.  
“document\_type”) and reading docs about other NoSQL databases is  
appears that they store field names verbatim and as a result the size  
of database greatly varies depending on the length of field name  
(especially when number/length of fields are greater their value)

A common suggestion is to shorten the field name (i.e. make  
“document\_type” into “dt”) to address the problem. Would the same  
suggestion apply to ElasticSearch?

Thanks,

-- Andy

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [February 8, 2012, 7:31pm UTC](https://discuss.elastic.co/t/field-name-length-and-elasticsearch-performance/6645/2 "2012-02-08T19:31:07Z")

</div>

On Wed, 2012-02-08 at 10:36 -0800, andym wrote:

> Hi,
> 
> Will the size of the Elasticsearch index decrease (and performance  
> increase due to reduce memory footprint) if I were to shorten field  
> names?
> 
> I have many fields in index which have descriptive names (i.e.  
> âdocument\_typeâ) and reading docs about other NoSQL databases is  
> appears that they store field names verbatim and as a result the size  
> of database greatly varies depending on the length of field name  
> (especially when number/length of fields are greater their value)
> 
> A common suggestion is to shorten the field name (i.e. make  
> âdocument\_typeâ into âdtâ) to address the problem. Would the same  
> suggestion apply to Elasticsearch?

Field names are used in two places:

1. in the Lucene index
2. in the stored \_source

In the Lucene index, field names are stored once, and the \_source can be  
compressed. Normally, the amount of storage used for your field names is  
dwarfed by the amount of storage used for your data.

Frankly, I think this is a premature optimization, and it makes much  
more sense to keep things readable and maintainable

clint

---

<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:** [July 6, 2017, 3:40am UTC](https://discuss.elastic.co/t/field-name-length-and-elasticsearch-performance/6645/3 "2017-07-06T03:40:05Z")

</div>


