# Python3 query with large results, best approach

**URL:** <https://discuss.elastic.co/t/python3-query-with-large-results-best-approach/257402>\
**Category:** Elasticsearch\
**Created:** [December 2, 2020, 5:42pm UTC](https://discuss.elastic.co/t/python3-query-with-large-results-best-approach/257402 "2020-12-02T17:42:20Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Emanuil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emanuil/32/36783_2.png) [@Emanuil](https://discuss.elastic.co/u/Emanuil)\
**Post date:** [December 3, 2020, 11:25pm UTC](https://discuss.elastic.co/t/python3-query-with-large-results-best-approach/257402/7 "2020-12-03T23:25:33Z")

</div>

You might find [this blog post](https://www.elastic.co/blog/improving-the-performance-of-high-cardinality-terms-aggregations-in-elasticsearch) on high cardinality terms aggregation optimisations useful. [This forum topic](https://discuss.elastic.co/t/high-cardinality-aggregation-alternate-approaches-2-million-buckets/222814) may also help you, in particular the examples of [aggregation partitioning](https://www.elastic.co/guide/en/elasticsearch/reference/7.10/search-aggregations-bucket-terms-aggregation.html#_filtering_values_with_partitions) being discussed.

---

_[View the full topic](https://discuss.elastic.co/t/python3-query-with-large-results-best-approach/257402)._
