# Fast queries in batches

**URL:** <https://discuss.elastic.co/t/fast-queries-in-batches/167160>\
**Category:** Elasticsearch\
**Created:** [February 5, 2019, 4:32pm UTC](https://discuss.elastic.co/t/fast-queries-in-batches/167160 "2019-02-05T16:32:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![magorbe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magorbe/32/36871_2.png) [@magorbe](https://discuss.elastic.co/u/magorbe)\
**Post date:** [February 5, 2019, 4:32pm UTC](https://discuss.elastic.co/t/fast-queries-in-batches/167160/1 "2019-02-05T16:32:13Z")

</div>

Hi. I'm doing a search on ES and it's:

```
query = {
            "_source": false,                                      
            "query": {
                "ids": {

                    "values": ids
                }
            }
        }

```

I do it in batches of 100 ids. And the response times I get are the following:

78it [00:00, 777.80it / s]  
102it [00:02, 34.64it / s]  
200it [00:04, 37.07it / s]  
300it [00:06, 38.28it / s]  
400it [00:09, 38.45it / s]  
500it [00:11, 39.17it / s]  
600it [00:14, 39.93it / s]  
700it [00:16, 41.03it / s]  
800it [00:18, 41.58it / s]  
900it [00:27, 23.02it / s]  
**1000it [00:36, 17.41it / s]**  
**1100it [00:45, 14.95it/s]**  
**1200it [00:55, 12.95it/s]**  
**1300it [01:05, 11.87it/s]**  
**1400it [01:15, 11.42it/s]**  
**1500it [01:24, 11.26it/s]**

Does anyone know why this decrease in speed as the consultations progress? Is there any way to maintain the initial speed?

Thanks!

---

<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 5, 2019, 4:32pm UTC](https://discuss.elastic.co/t/fast-queries-in-batches/167160/2 "2019-03-05T16:32:21Z")

</div>

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