# What is a good number of fields to have in an index?

**URL:** <https://discuss.elastic.co/t/what-is-a-good-number-of-fields-to-have-in-an-index/290618>\
**Category:** Elasticsearch\
**Created:** [December 1, 2021, 2:26am UTC](https://discuss.elastic.co/t/what-is-a-good-number-of-fields-to-have-in-an-index/290618 "2021-12-01T02:26:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sidharth\_vijayakumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sidharth_vijayakumar/32/97257_2.png) [@sidharth\_vijayakumar](https://discuss.elastic.co/u/sidharth_vijayakumar)\
**Post date:** [December 1, 2021, 2:26am UTC](https://discuss.elastic.co/t/what-is-a-good-number-of-fields-to-have-in-an-index/290618/1 "2021-12-01T02:26:43Z")

</div>

I am trying to manage the index and I would like to know how many fields must be present inside an index for it to have good performance. Currently, I have 6000 fields in my index but not all documents have 6000 fields it depends on the document (all docs has around (150-45 fields).

Is this gonna impact performance of querying and dashboards?

---

<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:** [December 1, 2021, 5:59am UTC](https://discuss.elastic.co/t/what-is-a-good-number-of-fields-to-have-in-an-index/290618/2 "2021-12-01T05:59:48Z")

</div>

The recommendation is \<1000. Performance will depend on your queries and mappings.

---

<div class="post-metadata">

**Author:** ![sidharth\_vijayakumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sidharth_vijayakumar/32/97257_2.png) [@sidharth\_vijayakumar](https://discuss.elastic.co/u/sidharth_vijayakumar)\
**Post date:** [December 1, 2021, 7:25am UTC](https://discuss.elastic.co/t/what-is-a-good-number-of-fields-to-have-in-an-index/290618/3 "2021-12-01T07:25:11Z")

</div>

Hi @warkolm ,  
U mean to say all docs must have around 1000 fields or total fields for an index patter is 1000?

---

<div class="post-metadata">

**Author:** ![DineshNaik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dineshnaik/32/89308_2.png) [@DineshNaik](https://discuss.elastic.co/u/DineshNaik)\
**Post date:** [December 1, 2021, 7:53am UTC](https://discuss.elastic.co/t/what-is-a-good-number-of-fields-to-have-in-an-index/290618/4 "2021-12-01T07:53:19Z")

</div>

@sidharth_vijayakumar  
An index can have many documents (similar in nature) and every document can have a certain number of fields.

An index can be divided into multiple shards . There is a limitation of 2.14 Billion docs per shard at lucene level but you should not go beyond 1 Billion documents at any point ( in fact best practice is to have a shard of 20-30 GB in size).

If you use mapping then the default limit of index.mapping.total\_fields.limit is 1000 in ES .

Note: this limitation can be changed if needed (not recommended) and is for a document. That means one document should not have more than 1000 fields in your index.

You can refer [this](https://discuss.elastic.co/t/implications-of-large-number-of-fields-in-a-document/113308) post to get an idea.

---

<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 29, 2021, 7:53am UTC](https://discuss.elastic.co/t/what-is-a-good-number-of-fields-to-have-in-an-index/290618/5 "2021-12-29T07:53:53Z")

</div>

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