# Use elasticsearch for continuous queries

**URL:** <https://discuss.elastic.co/t/use-elasticsearch-for-continuous-queries/42299>\
**Category:** Elasticsearch\
**Created:** [February 20, 2016, 9:46am UTC](https://discuss.elastic.co/t/use-elasticsearch-for-continuous-queries/42299 "2016-02-20T09:46:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![arman1371](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@arman1371](https://discuss.elastic.co/u/arman1371)\
**Post date:** [February 20, 2016, 9:46am UTC](https://discuss.elastic.co/t/use-elasticsearch-for-continuous-queries/42299/1 "2016-02-20T09:46:32Z")

</div>

How to use elasticsearch as back-end of continues queries?  
I have some queries that should be executed each 1 minute, in 1 day windows.  
How to achieve this with best performance?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 20, 2016, 3:39pm UTC](https://discuss.elastic.co/t/use-elasticsearch-for-continuous-queries/42299/2 "2016-02-20T15:39:04Z")

</div>

Executing a query on elasticsearch every minute is not an issue.

Why do you think it's not doable or that you might have performance issues?

---

<div class="post-metadata">

**Author:** ![arman1371](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@arman1371](https://discuss.elastic.co/u/arman1371)\
**Post date:** [February 21, 2016, 5:40am UTC](https://discuss.elastic.co/t/use-elasticsearch-for-continuous-queries/42299/3 "2016-02-21T05:40:01Z")

</div>

Because this query uses many resources and each minute these calculations should executed.  
my objects are time based, so last objects not change. I don't want this calculations executed each minute, instead, execute once and for next queries use that result aggregated with new result.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 21, 2016, 10:51am UTC](https://discuss.elastic.co/t/use-elasticsearch-for-continuous-queries/42299/4 "2016-02-21T10:51:09Z")

</div>

Do you have any example ?

---

<div class="post-metadata">

**Author:** ![arman1371](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@arman1371](https://discuss.elastic.co/u/arman1371)\
**Post date:** [February 21, 2016, 11:18am UTC](https://discuss.elastic.co/t/use-elasticsearch-for-continuous-queries/42299/5 "2016-02-21T11:18:12Z")

</div>

Foe example minimum of download size in a network.  
Download size of yesterday is never change anymore and can be calculated once, not each minute

---

<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:** [February 21, 2016, 7:31pm UTC](https://discuss.elastic.co/t/use-elasticsearch-for-continuous-queries/42299/6 "2016-02-21T19:31:31Z")

</div>

If you want the result from yesterday to be stored, you will need to save that in a new index. It's not something ES does itself.

---

<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:14pm UTC](https://discuss.elastic.co/t/use-elasticsearch-for-continuous-queries/42299/7 "2017-07-05T23:14:36Z")

</div>


