# Consistent Query Impact on Sharding and Health in Elasticsearch

**URL:** <https://discuss.elastic.co/t/consistent-query-impact-on-sharding-and-health-in-elasticsearch/364707>\
**Category:** Elasticsearch\
**Created:** [August 9, 2024, 5:29pm UTC](https://discuss.elastic.co/t/consistent-query-impact-on-sharding-and-health-in-elasticsearch/364707 "2024-08-09T17:29:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanjaygorur](https://avatars.discourse-cdn.com/v4/letter/s/f04885/32.png) [@sanjaygorur](https://discuss.elastic.co/u/sanjaygorur)\
**Post date:** [August 9, 2024, 5:29pm UTC](https://discuss.elastic.co/t/consistent-query-impact-on-sharding-and-health-in-elasticsearch/364707/1 "2024-08-09T17:29:21Z")

</div>

We are using elasticsearch version 1.4, and have a looping pagination query used to collect docs from one index.

How does querying an entry in elasticsearch repeatedly have an impact on sharding, and why would it have an impact on shards of other indexes as well?

---

<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:** [August 9, 2024, 5:35pm UTC](https://discuss.elastic.co/t/consistent-query-impact-on-sharding-and-health-in-elasticsearch/364707/2 "2024-08-09T17:35:08Z")

</div>

> [@sanjaygorur](#):
>
> We are using elasticsearch version 1.4

If this is indeed the version you are using I would strongly recommend you upgrade to the latest version as it is very, very old and it may be difficult to find anyone with any reasonably recent experience of it nowadays.

I also do not really understand your query so it would help if you could explain in more detail exactly what you are doing and what problem you are facing.

---

<div class="post-metadata">

**Author:** ![sanjaygorur](https://avatars.discourse-cdn.com/v4/letter/s/f04885/32.png) [@sanjaygorur](https://discuss.elastic.co/u/sanjaygorur)\
**Post date:** [August 9, 2024, 5:40pm UTC](https://discuss.elastic.co/t/consistent-query-impact-on-sharding-and-health-in-elasticsearch/364707/3 "2024-08-09T17:40:52Z")

</div>

Hi Christian,

Our query is just set to gather docs that fulfill a case of having set flags.

For each pagination query (in a loop), we hit 10,000 documents (the maximum?) and adjust the FROM parameter to obtain the next set of documents. The total number of documents is \> 10 million.

We also use the cluster health endpoint to wait for a green status, but is it necessary to wait on the number of active/relocating shards as well? How does querying documents impact that?

Is efficient pagination available in es versions \<= 1.4?

---

<div class="post-metadata">

**Author:** ![sanjaygorur](https://avatars.discourse-cdn.com/v4/letter/s/f04885/32.png) [@sanjaygorur](https://discuss.elastic.co/u/sanjaygorur)\
**Post date:** [August 9, 2024, 5:41pm UTC](https://discuss.elastic.co/t/consistent-query-impact-on-sharding-and-health-in-elasticsearch/364707/4 "2024-08-09T17:41:49Z")

</div>

Furthermore, it was noticed that the cluster health was impacted after the script was done running?

How could that happen?

---

<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:** [August 9, 2024, 6:21pm UTC](https://discuss.elastic.co/t/consistent-query-impact-on-sharding-and-health-in-elasticsearch/364707/5 "2024-08-09T18:21:30Z")

</div>

> [@sanjaygorur](#):
>
> We also use the cluster health endpoint to wait for a green status, but is it necessary to wait on the number of active/relocating shards as well? How does querying documents impact that?
> 
> Is efficient pagination available in es versions \<= 1.4?

> [@sanjaygorur](#):
>
> Furthermore, it was noticed that the cluster health was impacted after the script was done running?
> 
> How could that happen?

I have no idea. Elasticsearch 1.4 is almost 10 years old and I have not used it for probably at least 8 or 9 years, so will not be able to help much since A LOT has changed since then.
