# ML - deleting old indexes in Elasticsearch

**URL:** <https://discuss.elastic.co/t/ml-deleting-old-indexes-in-elasticsearch/165617>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-machine-learning\
**Created:** [January 24, 2019, 1:57pm UTC](https://discuss.elastic.co/t/ml-deleting-old-indexes-in-elasticsearch/165617 "2019-01-24T13:57:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rohlik](https://avatars.discourse-cdn.com/v4/letter/r/aeb1de/32.png) [@Rohlik](https://discuss.elastic.co/u/Rohlik)\
**Post date:** [January 24, 2019, 1:57pm UTC](https://discuss.elastic.co/t/ml-deleting-old-indexes-in-elasticsearch/165617/1 "2019-01-24T13:57:27Z")

</div>

Hello,  
I cannot find any relevant information in the docs, so I decided to ask here.

Situation:  
We have real-time ML job on specific indexes.  
We are using daily indexes and our oldest index is two years old.  
What if we will delete all indexes from 2017? Will be our ML model bounds more inaccurate then?  
Are they old indexes needed for ML jobs which are already setup?

---

<div class="post-metadata">

**Author:** ![richcollier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/richcollier/32/115035_2.png) [@richcollier](https://discuss.elastic.co/u/richcollier)\
**Post date:** [January 25, 2019, 2:48pm UTC](https://discuss.elastic.co/t/ml-deleting-old-indexes-in-elasticsearch/165617/2 "2019-01-25T14:48:51Z")

</div>

Hello Thomas,

I assume when you say "What if we will delete all indexes from 2017" you mean the indices that contain the raw data that the ML job is analyzing? If that's the case, then yes - you are perfectly safe to delete those indices - as the ML job's model does not need to look at that data again. Data is analyzed by ML in chronological order and is only viewed once. The cumulative model of behavior for that data is stored in the `.ml-state` index.

The ONLY downside of deleting the old data is that any newly created jobs can only learn from the historical data that you _do_ have. But, if this data is very old (as you say, from 2017) it is less useful for that purpose anyway.

---

<div class="post-metadata">

**Author:** ![Rohlik](https://avatars.discourse-cdn.com/v4/letter/r/aeb1de/32.png) [@Rohlik](https://discuss.elastic.co/u/Rohlik)\
**Post date:** [January 28, 2019, 8:52am UTC](https://discuss.elastic.co/t/ml-deleting-old-indexes-in-elasticsearch/165617/3 "2019-01-28T08:52:43Z")

</div>

This is exactly what I want to know. Thank you 😉

---

<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:** [February 25, 2019, 9:05am UTC](https://discuss.elastic.co/t/ml-deleting-old-indexes-in-elasticsearch/165617/4 "2019-02-25T09:05:29Z")

</div>

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