# Elastic Search - Scrolling for Not too many documents?

**URL:** <https://discuss.elastic.co/t/elastic-search-scrolling-for-not-too-many-documents/168992>\
**Category:** Elasticsearch\
**Created:** [February 19, 2019, 10:18am UTC](https://discuss.elastic.co/t/elastic-search-scrolling-for-not-too-many-documents/168992 "2019-02-19T10:18:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Avdhey\_Tiwari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/avdhey_tiwari/32/41106_2.png) [@Avdhey\_Tiwari](https://discuss.elastic.co/u/Avdhey_Tiwari)\
**Post date:** [February 19, 2019, 10:18am UTC](https://discuss.elastic.co/t/elastic-search-scrolling-for-not-too-many-documents/168992/1 "2019-02-19T10:18:08Z")

</div>

We have a use-case where we are querying elastic for an unknown number of results, with very aggressive latency requirements.  
In 99 percentile of scenarios, the result-set \< page size. In \<= 1 percentile, the results may be \> page size. Since we need to return all results in one go, without pagination, does it make sense to use scrolling for all requests, even though it will be used very rarely? Or does it make sense for \< 1 percentile scenarios, to make subsequent standalone requests to collect all the results before returning the result set?

**Is there any initial overhead to initiating a scroll session**?

I see the documentation [https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html) mentions Scrolling is not intended for real time user requests, but rather for processing large amounts of data, e.g. in order to reindex the contents of one index into a new index with a different configuration. But in general will the performance be detrimental if scrolling-sessions are initiated for all requests?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 19, 2019, 10:34am UTC](https://discuss.elastic.co/t/elastic-search-scrolling-for-not-too-many-documents/168992/2 "2019-02-19T10:34:05Z")

</div>

Not really a performance thing but more about locking some files on the filesystem IMO plus the memory needed to hold all scrolls.

At least you should clear the scroll or use a very small timeout like some seconds may be?

Never did that though.

---

<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 19, 2019, 10:34am UTC](https://discuss.elastic.co/t/elastic-search-scrolling-for-not-too-many-documents/168992/3 "2019-03-19T10:34:12Z")

</div>

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