# Revisiting the "Most efficient way to get all IDs"

**URL:** <https://discuss.elastic.co/t/revisiting-the-most-efficient-way-to-get-all-ids/185169>\
**Category:** Elasticsearch\
**Created:** [June 11, 2019, 11:03am UTC](https://discuss.elastic.co/t/revisiting-the-most-efficient-way-to-get-all-ids/185169 "2019-06-11T11:03:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bruth](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bruth/32/47817_2.png) [@bruth](https://discuss.elastic.co/u/bruth)\
**Post date:** [June 11, 2019, 11:03am UTC](https://discuss.elastic.co/t/revisiting-the-most-efficient-way-to-get-all-ids/185169/1 "2019-06-11T11:03:17Z")

</div>

Continuing the discussion from [Most efficient way to get all ids of a type](https://discuss.elastic.co/t/most-efficient-way-to-get-all-ids-of-a-type/47111/3):

@nik9000 You left a comment stating that if the use case could be modeled as an aggregation, then the column store would be implicitly used which may speed up performance. I was curious of exploring this a bit more.

My use case is that I was to snapshot the set of IDs for a specific search result. These IDs are shared entity identifiers that other services can utilize to do other things. The application using ES is for search/discovery, but these set of IDs can be used as input to other things.

The Scroll API works pretty well. In an extreme case, I can extract ~950k ids in ~19s using a parallel sliced scroll and as low as 700ms for a more reasonable set of 12k ids. But I was curious if there were any other optimizations that come to mind. I have tried different combinations of slice size, replicas, and max slices.

---

<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 9, 2019, 11:03am UTC](https://discuss.elastic.co/t/revisiting-the-most-efficient-way-to-get-all-ids/185169/2 "2019-07-09T11:03:37Z")

</div>

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