# Cardinality, precision, and Top 10

**URL:** <https://discuss.elastic.co/t/cardinality-precision-and-top-10/216303>\
**Category:** Elasticsearch\
**Created:** [January 23, 2020, 5:43pm UTC](https://discuss.elastic.co/t/cardinality-precision-and-top-10/216303 "2020-01-23T17:43:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![axlrosen](https://avatars.discourse-cdn.com/v4/letter/a/e19adc/32.png) [@axlrosen](https://discuss.elastic.co/u/axlrosen)\
**Post date:** [January 23, 2020, 5:43pm UTC](https://discuss.elastic.co/t/cardinality-precision-and-top-10/216303/1 "2020-01-23T17:43:25Z")

</div>

We're currently evaluating Elasticsearch, and trying to get a handle on the approximate counts in cardinality aggregations. I understand that the default value for 'precision\_threshold' is 3000, and this means that if the cardinality of a field is below 3000, you'll basically get an exact answer. So if the answer I get back is below 3000 -- let's say it's 33 -- then I can be pretty confident that 33 is the exactly correct number. But if the number that's returned is above 3000, then it might be around 1% or 2% off from the exact number.

My question is about Top 10 (group by) queries. If I get 10 results back, and each number is less than 3000, does that basically mean that they are exact answers? The [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-cardinality-aggregation.html#_counts_are_approximate) doesn't make this very clear.

My guess is no -- I think that it's actually the total cardinality of the field, _before_ grouping, that matters. Therefore, if I do a Top 10 query and one of the items in my list has a value of 33, the actual exact answer might be 32. Is that right?

---

<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:** [February 20, 2020, 5:43pm UTC](https://discuss.elastic.co/t/cardinality-precision-and-top-10/216303/2 "2020-02-20T17:43:25Z")

</div>

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