# Elasticsearch 5.6 scroll query takes longer

**URL:** <https://discuss.elastic.co/t/elasticsearch-5-6-scroll-query-takes-longer/297971>\
**Category:** Elasticsearch\
**Created:** [February 23, 2022, 5:47am UTC](https://discuss.elastic.co/t/elasticsearch-5-6-scroll-query-takes-longer/297971 "2022-02-23T05:47:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mario12](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mario12/32/29324_2.png) [@mario12](https://discuss.elastic.co/u/mario12)\
**Post date:** [February 23, 2022, 5:47am UTC](https://discuss.elastic.co/t/elasticsearch-5-6-scroll-query-takes-longer/297971/1 "2022-02-23T05:47:50Z")

</div>

We are using a scroll query to load all the documents from ES 2.4. It took less than 2 minutes to load 3 million documents. We recently upgrade to ES 5.6 and it takes 10-12 minutes on average. We are using \_doc for sort and the order is DESC for ES 5.6. We used \_doc and there was no order specified in ES 2.4 (null was passed into the Java client library ES 2.4). But, in the Java client library for ES 5.6 the option to pass null is removed. So, we are passing DESC. How can we optimize the scroll query in ES 5.6?

---

<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 23, 2022, 5:47am UTC](https://discuss.elastic.co/t/elasticsearch-5-6-scroll-query-takes-longer/297971/2 "2022-02-23T05:47:50Z")

</div>

Elasticsearch 5.6 is [EOL](https://www.elastic.co/support/eol) and no longer supported. Please upgrade ASAP.

(This is an automated response from your friendly Elastic bot. Please report this post if you have any suggestions or concerns :elasticheart: )

---

<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:** [March 23, 2022, 5:47am UTC](https://discuss.elastic.co/t/elasticsearch-5-6-scroll-query-takes-longer/297971/3 "2022-03-23T05:47:51Z")

</div>

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