# Indexing performance of high cardinality field

**URL:** <https://discuss.elastic.co/t/indexing-performance-of-high-cardinality-field/40015>\
**Category:** Elasticsearch\
**Created:** [January 25, 2016, 11:17am UTC](https://discuss.elastic.co/t/indexing-performance-of-high-cardinality-field/40015 "2016-01-25T11:17:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaharmor](https://avatars.discourse-cdn.com/v4/letter/s/58f4c7/32.png) [@shaharmor](https://discuss.elastic.co/u/shaharmor)\
**Post date:** [January 25, 2016, 11:17am UTC](https://discuss.elastic.co/t/indexing-performance-of-high-cardinality-field/40015/1 "2016-01-25T11:17:18Z")

</div>

Hi,

Considering i have a `long` typed field with very high cardinality,  
is it possible that it will affect CPU performance a lot for the indexing of it?

I am not using it for filtering, only for the aggregation results.

Should i consider change its mapping to `index: no`? Have anyone seen a performance boost for indexing from it?

---

<div class="post-metadata">

**Author:** ![bleskes](https://avatars.discourse-cdn.com/v4/letter/b/71c47a/32.png) [@bleskes](https://discuss.elastic.co/u/bleskes)\
**Post date:** [January 25, 2016, 12:58pm UTC](https://discuss.elastic.co/t/indexing-performance-of-high-cardinality-field/40015/2 "2016-01-25T12:58:23Z")

</div>

of course it all depends. A long field typically doesn't carry much overhead but if you have a _Iot_ of them and you don't need it for searching, you can disable indexing and see what happens. Of course, if you change your mind and you'd like to search it after all, you'd need to reindex.

---

<div class="post-metadata">

**Author:** ![shaharmor](https://avatars.discourse-cdn.com/v4/letter/s/58f4c7/32.png) [@shaharmor](https://discuss.elastic.co/u/shaharmor)\
**Post date:** [January 25, 2016, 1:01pm UTC](https://discuss.elastic.co/t/indexing-performance-of-high-cardinality-field/40015/3 "2016-01-25T13:01:01Z")

</div>

But does the cardinality of the field matters? Or the number of events with this field?

Also, if i disable indexing for the field, does it mean i won't be able to search/filter by it, or just that it won't be fast?

---

<div class="post-metadata">

**Author:** ![bleskes](https://avatars.discourse-cdn.com/v4/letter/b/71c47a/32.png) [@bleskes](https://discuss.elastic.co/u/bleskes)\
**Post date:** [January 25, 2016, 1:48pm UTC](https://discuss.elastic.co/t/indexing-performance-of-high-cardinality-field/40015/4 "2016-01-25T13:48:19Z")

</div>

> [@shaharmor](#):
>
> But does the cardinality of the field matters? Or the number of events with this field?

Both. Each value needs to be index. Note though, the total unique values in an index tends to matter less here. It's the total values to be indexed per second.

> Also, if i disable indexing for the field, does it mean i won't be able to search/filter by it, or just that it won't be fast?

If you don't index it, you won't be able use it for filtering/searching and sorting.

---

<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 5, 2017, 11:21pm UTC](https://discuss.elastic.co/t/indexing-performance-of-high-cardinality-field/40015/5 "2017-07-05T23:21:55Z")

</div>


