# Sorting on large index

**URL:** <https://discuss.elastic.co/t/sorting-on-large-index/235017>\
**Category:** Elasticsearch\
**Created:** [May 30, 2020, 1:06pm UTC](https://discuss.elastic.co/t/sorting-on-large-index/235017 "2020-05-30T13:06:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![YvorL](https://avatars.discourse-cdn.com/v4/letter/y/9fc348/32.png) [@YvorL](https://discuss.elastic.co/u/YvorL)\
**Post date:** [May 30, 2020, 1:06pm UTC](https://discuss.elastic.co/t/sorting-on-large-index/235017/1 "2020-05-30T13:06:39Z")

</div>

Hi!

I read about index sorting in the [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules-index-sorting.html), but I don't know what are the limits and if there's any downside to do it. For example, I have a daily index with around 500M documents. I'd sort it by 5 fields from very low (100-200) cardinality to very high (potentially million).  
How does this affect the indexing time? How many fields can I use? Should I omit very high cardinality fields even if those are frequently searched?

Thanks!

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [May 30, 2020, 1:16pm UTC](https://discuss.elastic.co/t/sorting-on-large-index/235017/2 "2020-05-30T13:16:28Z")

</div>

[This blog post](https://www.elastic.co/blog/index-sorting-elasticsearch-6-0) discusses overhead and the impact on indexing performance, which it can be substantial. I think it primarily makes sense for search heavy use cases where the additional work at indexing time is a good trade-off.

---

<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:** [June 27, 2020, 1:16pm UTC](https://discuss.elastic.co/t/sorting-on-large-index/235017/3 "2020-06-27T13:16:28Z")

</div>

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