# Fetching 50,000 documents, not sorted

**URL:** <https://discuss.elastic.co/t/fetching-50-000-documents-not-sorted/31544>\
**Category:** Elasticsearch\
**Created:** [October 2, 2015, 2:23pm UTC](https://discuss.elastic.co/t/fetching-50-000-documents-not-sorted/31544 "2015-10-02T14:23:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ziv2081](https://avatars.discourse-cdn.com/v4/letter/z/d2c977/32.png) [@ziv2081](https://discuss.elastic.co/u/ziv2081)\
**Post date:** [October 2, 2015, 2:23pm UTC](https://discuss.elastic.co/t/fetching-50-000-documents-not-sorted/31544/1 "2015-10-02T14:23:50Z")

</div>

Hey all,

Sometimes we need to do client side joins as we do not want to denormalise all the data due to capacity and storage issues.

For what it seems, running a query to just match all and return all, gets around 50,000 documents per seconds.  
This is all done on a single index with a single shard.  
SSD with 80k IOPS for READ and 8 core cpu.

This is using the python api.

With MySQL for example, we can fetch 1M rows per second.  
Is there any way to tweak the settings to improve elastic's fetch capabilities?  
It doesn't seem like a network issue as it doesn't use much bandwidth.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 4, 2015, 2:11am UTC](https://discuss.elastic.co/t/fetching-50-000-documents-not-sorted/31544/2 "2015-10-04T02:11:59Z")

</div>

Why not use [scan and scroll](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html) instead?

---

<div class="post-metadata">

**Author:** ![ziv2081](https://avatars.discourse-cdn.com/v4/letter/z/d2c977/32.png) [@ziv2081](https://discuss.elastic.co/u/ziv2081)\
**Post date:** [October 7, 2015, 8:48am UTC](https://discuss.elastic.co/t/fetching-50-000-documents-not-sorted/31544/3 "2015-10-07T08:48:59Z")

</div>

This seemed a bit faster than the regular fetch. but not by much.  
got around 80k per second.

---

<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:** [October 7, 2015, 9:07am UTC](https://discuss.elastic.co/t/fetching-50-000-documents-not-sorted/31544/4 "2015-10-07T09:07:10Z")

</div>

Have you tried using a larger number of shards?

---

<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, 11:46pm UTC](https://discuss.elastic.co/t/fetching-50-000-documents-not-sorted/31544/5 "2017-07-05T23:46:14Z")

</div>


