# Performance issue when working with large array

**URL:** <https://discuss.elastic.co/t/performance-issue-when-working-with-large-array/60970>\
**Category:** Elasticsearch\
**Created:** [September 20, 2016, 6:45am UTC](https://discuss.elastic.co/t/performance-issue-when-working-with-large-array/60970 "2016-09-20T06:45:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cju](https://avatars.discourse-cdn.com/v4/letter/c/5daacb/32.png) [@cju](https://discuss.elastic.co/u/cju)\
**Post date:** [September 20, 2016, 6:45am UTC](https://discuss.elastic.co/t/performance-issue-when-working-with-large-array/60970/1 "2016-09-20T06:45:49Z")

</div>

Hello,

I face a huge drop in performance when I work with huge arrays (thousand elements).  
Is it something expected ? Is there a way to understand how arrays are internally handled by elasticsearch ?

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [September 20, 2016, 10:32am UTC](https://discuss.elastic.co/t/performance-issue-when-working-with-large-array/60970/2 "2016-09-20T10:32:11Z")

</div>

What kind of performance are we talking about? Indexing or searching? Can you quantify the slow down?

---

<div class="post-metadata">

**Author:** ![cju](https://avatars.discourse-cdn.com/v4/letter/c/5daacb/32.png) [@cju](https://discuss.elastic.co/u/cju)\
**Post date:** [September 21, 2016, 12:27pm UTC](https://discuss.elastic.co/t/performance-issue-when-working-with-large-array/60970/3 "2016-09-21T12:27:02Z")

</div>

I check my benchmark after your question and I have to apologize because it was my mistake. A part of my application was not well tested. So there is no more drop of performance.

But still, I wonder if it's a good practice to have big arrays in an elasticsearch document ?

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [October 14, 2016, 3:07pm UTC](https://discuss.elastic.co/t/performance-issue-when-working-with-large-array/60970/4 "2016-10-14T15:07:46Z")

</div>

It depends how large it is. In general, for in field that is only indexed, things should be fine, the index is built to handle high-cadinality fields gracefully. However I would be more careful with doc values which tend to like better when documents have a reasonable number of values (say a couple dozens at most).

---

<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, 10:12pm UTC](https://discuss.elastic.co/t/performance-issue-when-working-with-large-array/60970/5 "2017-07-05T22:12:14Z")

</div>


