# Refresh interval on indices with no changes

**URL:** <https://discuss.elastic.co/t/refresh-interval-on-indices-with-no-changes/248368>\
**Category:** Elasticsearch\
**Created:** [September 11, 2020, 5:48pm UTC](https://discuss.elastic.co/t/refresh-interval-on-indices-with-no-changes/248368 "2020-09-11T17:48:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Silas\_Hansen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/silas_hansen/32/67521_2.png) [@Silas\_Hansen](https://discuss.elastic.co/u/Silas_Hansen)\
**Post date:** [September 11, 2020, 5:48pm UTC](https://discuss.elastic.co/t/refresh-interval-on-indices-with-no-changes/248368/1 "2020-09-11T17:48:24Z")

</div>

If I explicitly set a refresh\_interval on an index, will it still run the refresh operation, even if no new documents have been indexed to it since the last refresh?

I'm trying to understand if setting an explicit refresh interval ends up being more costly, because it disables the automatic idle-functionality that I know happens if no searches are being made as described [here](https://www.elastic.co/guide/en/elasticsearch/reference/master/index-modules.html#dynamic-index-settings). I wonder if thats the case for index operations as well.

If it does the refresh in any case when explicity set, are refreshes on an index that hasn't changed expensive or near zero cost?

Possibly linking to the source code as well would be extremely helpful. I haven't been able to find the code responsible for this.

Thanks!

---

<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:** [September 12, 2020, 7:59am UTC](https://discuss.elastic.co/t/refresh-interval-on-indices-with-no-changes/248368/2 "2020-09-12T07:59:31Z")

</div>

Refresh interval is set by default and will only run if there are new additions or changes to be published so there is no overhead. The part you mention described how the shard can postpone refreshing (which can be an expensive operation) for shards that are not searched. If you have nothing changing in the index it does not apply.

---

<div class="post-metadata">

**Author:** ![Silas\_Hansen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/silas_hansen/32/67521_2.png) [@Silas\_Hansen](https://discuss.elastic.co/u/Silas_Hansen)\
**Post date:** [September 14, 2020, 10:29am UTC](https://discuss.elastic.co/t/refresh-interval-on-indices-with-no-changes/248368/3 "2020-09-14T10:29:16Z")

</div>

Thanks, that answers my question!

Maybe that would be helpful in the documentation as well. Right now it only talks about how indices that are not being searched, will not need to refresh.

---

<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:** [October 12, 2020, 10:29am UTC](https://discuss.elastic.co/t/refresh-interval-on-indices-with-no-changes/248368/4 "2020-10-12T10:29:50Z")

</div>

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