# Delete by query and index performance

**URL:** <https://discuss.elastic.co/t/delete-by-query-and-index-performance/20913>\
**Category:** Elasticsearch\
**Created:** [November 24, 2014, 2:09pm UTC](https://discuss.elastic.co/t/delete-by-query-and-index-performance/20913 "2014-11-24T14:09:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BradVido](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bradvido/32/741_2.png) [@BradVido](https://discuss.elastic.co/u/BradVido)\
**Post date:** [November 24, 2014, 2:09pm UTC](https://discuss.elastic.co/t/delete-by-query-and-index-performance/20913/1 "2014-11-24T14:09:27Z")

</div>

I have data in an ES index that dynamically changes. Various documents may  
be deleted at any time and new ones are always being created.  
Using the "delete by query" works perfectly to handle the deletes, but I've  
read that this can be detrimental to index performance and I've stated to  
see poor performance.

How detrimental is delete by query to an index and is there any way to  
repair it? Does a optimize/forcemerge help with this problem?

ThTHanks!

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/a8f17206-6c98-4258-9453-cc0f04d26c1d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a8f17206-6c98-4258-9453-cc0f04d26c1d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [November 24, 2014, 9:12pm UTC](https://discuss.elastic.co/t/delete-by-query-and-index-performance/20913/2 "2014-11-24T21:12:47Z")

</div>

Optimize/force merge does not help. It will only add load. If search times  
increase, and deletes were massive, you should consider optimize. But not  
too often, maybe once per hour.

Deleting single documents is expensive by nature of the algorithm, there is  
no "repair".

Jörg

On Mon, Nov 24, 2014 at 3:09 PM, BradVido [bradyvidovic@gmail.com](mailto:bradyvidovic@gmail.com) wrote:

> I have data in an ES index that dynamically changes. Various documents may  
> be deleted at any time and new ones are always being created.  
> Using the "delete by query" works perfectly to handle the deletes, but  
> I've read that this can be detrimental to index performance and I've stated  
> to see poor performance.
> 
> How detrimental is delete by query to an index and is there any way to  
> repair it? Does a optimize/forcemerge help with this problem?
> 
> ThTHanks!
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/a8f17206-6c98-4258-9453-cc0f04d26c1d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a8f17206-6c98-4258-9453-cc0f04d26c1d%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/a8f17206-6c98-4258-9453-cc0f04d26c1d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/a8f17206-6c98-4258-9453-cc0f04d26c1d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEAFz78fGkjb9NsOO%2Be1Bbaj9e0S9DvRXANouaxk3SFgg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEAFz78fGkjb9NsOO%2Be1Bbaj9e0S9DvRXANouaxk3SFgg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![BradVido](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bradvido/32/741_2.png) [@BradVido](https://discuss.elastic.co/u/BradVido)\
**Post date:** [November 24, 2014, 11:55pm UTC](https://discuss.elastic.co/t/delete-by-query-and-index-performance/20913/3 "2014-11-24T23:55:36Z")

</div>

Aren't optimize and forcemerge the same thing?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/211286ed-dd15-43bb-89c9-5fe8baa1ca8e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/211286ed-dd15-43bb-89c9-5fe8baa1ca8e%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 12:47am UTC](https://discuss.elastic.co/t/delete-by-query-and-index-performance/20913/4 "2017-07-06T00:47:57Z")

</div>


