# Cardinality and Field Data

**URL:** <https://discuss.elastic.co/t/cardinality-and-field-data/32222>\
**Category:** Elasticsearch\
**Created:** [October 15, 2015, 12:34am UTC](https://discuss.elastic.co/t/cardinality-and-field-data/32222 "2015-10-15T00:34:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric\_Brandes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eric_brandes/32/1480_2.png) [@Eric\_Brandes](https://discuss.elastic.co/u/Eric_Brandes)\
**Post date:** [October 15, 2015, 12:34am UTC](https://discuss.elastic.co/t/cardinality-and-field-data/32222/1 "2015-10-15T00:34:11Z")

</div>

We're on the 1.4 series of ES and using cardinality aggregations for a few things. Recently we switched to using a hashed field for better performance. As part of that, we noticed that the hashed field is being stored in field data. I was under the impression the hyper log log implementation was specifically brought in to avoid this? The docs state that the cardinality agg uses a fixed memory set, but we're seeing field data rise with the cardinality of the field. Am I misunderstanding how that agg should work? We do no other aggs on that field, and we have confirmed that it's the cardinality agg specifically that causes it.

---

<div class="post-metadata">

**Author:** ![Maxim\_Valyanskiy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maxim_valyanskiy/32/787_2.png) [@Maxim\_Valyanskiy](https://discuss.elastic.co/u/Maxim_Valyanskiy)\
**Post date:** [October 15, 2015, 5:58am UTC](https://discuss.elastic.co/t/cardinality-and-field-data/32222/2 "2015-10-15T05:58:58Z")

</div>

Cardinality aggregation does not need extra memory to count distinct values. But field data is still needed to read values.

---

<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:44pm UTC](https://discuss.elastic.co/t/cardinality-and-field-data/32222/3 "2017-07-05T23:44:42Z")

</div>


