# On the advantage of search\_after under the hood

**URL:** <https://discuss.elastic.co/t/on-the-advantage-of-search-after-under-the-hood/362744>\
**Category:** Elasticsearch\
**Created:** [July 8, 2024, 10:52pm UTC](https://discuss.elastic.co/t/on-the-advantage-of-search-after-under-the-hood/362744 "2024-07-08T22:52:21Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [July 9, 2024, 7:15am UTC](https://discuss.elastic.co/t/on-the-advantage-of-search-after-under-the-hood/362744/2 "2024-07-09T07:15:03Z")

</div>

Please do not open multiple threads on the same issue.

> [@Chervine\_Majeri](#):
>
> Unless we're reading from a sorted index, it seems like elasticsearch will always read all matching rows into memory and then sort through them.

No, this is not at all how it works.

Please see [my response to your other thread](https://discuss.elastic.co/t/iterating-through-large-datasets-in-various-orders-efficiently/362743/2) for additional details.

---

_[View the full topic](https://discuss.elastic.co/t/on-the-advantage-of-search-after-under-the-hood/362744)._
