# How to get the best performance with index update

**URL:** <https://discuss.elastic.co/t/how-to-get-the-best-performance-with-index-update/193776>\
**Category:** Elasticsearch\
**Created:** [August 5, 2019, 10:56am UTC](https://discuss.elastic.co/t/how-to-get-the-best-performance-with-index-update/193776 "2019-08-05T10:56:34Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Henrique\_Brasileiro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/henrique_brasileiro/32/51630_2.png) [@Henrique\_Brasileiro](https://discuss.elastic.co/u/Henrique_Brasileiro)\
**Post date:** [August 5, 2019, 10:56am UTC](https://discuss.elastic.co/t/how-to-get-the-best-performance-with-index-update/193776/1 "2019-08-05T10:56:34Z")

</div>

I have a index with length greater than 1 TB and I want to update a field but update by query is very slow, mor slow that delete all and insert all.  
How best alternative to mass update?

---

<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:** [August 5, 2019, 11:19am UTC](https://discuss.elastic.co/t/how-to-get-the-best-performance-with-index-update/193776/2 "2019-08-05T11:19:46Z")

</div>

The best is to delete the index and index everything again.  
Using aliases might help to do it without interruption.

---

<div class="post-metadata">

**Author:** ![Henrique\_Brasileiro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/henrique_brasileiro/32/51630_2.png) [@Henrique\_Brasileiro](https://discuss.elastic.co/u/Henrique_Brasileiro)\
**Post date:** [August 5, 2019, 11:44am UTC](https://discuss.elastic.co/t/how-to-get-the-best-performance-with-index-update/193776/3 "2019-08-05T11:44:59Z")

</div>

This is currently the solution, but some one-to-many updates are being problematic for PostgreSQL mirroring.  
I was thinking of some [Bulk API](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html) based solution.

---

<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:** [August 5, 2019, 11:01pm UTC](https://discuss.elastic.co/t/how-to-get-the-best-performance-with-index-update/193776/4 "2019-08-05T23:01:10Z")

</div>

Using bulk is always a good idea IMO. But not really related to the question IMHO.

---

<div class="post-metadata">

**Author:** ![kumar8055](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@kumar8055](https://discuss.elastic.co/u/kumar8055)\
**Post date:** [August 6, 2019, 4:42am UTC](https://discuss.elastic.co/t/how-to-get-the-best-performance-with-index-update/193776/5 "2019-08-06T04:42:19Z")

</div>

Hi @dadoonet @Henrique_Brasileiro,

How about re-indexing??  
Configuring more shards can share the data and performing the update will be easy option right?

---

<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:** [August 6, 2019, 6:58am UTC](https://discuss.elastic.co/t/how-to-get-the-best-performance-with-index-update/193776/6 "2019-08-06T06:58:18Z")

</div>

Yeah. Reading the source documents from elasticsearch with reindex API is probably the way to go.

My first response was just about update by query vs index API.

---

<div class="post-metadata">

**Author:** ![kumar8055](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@kumar8055](https://discuss.elastic.co/u/kumar8055)\
**Post date:** [August 6, 2019, 3:57pm UTC](https://discuss.elastic.co/t/how-to-get-the-best-performance-with-index-update/193776/7 "2019-08-06T15:57:56Z")

</div>

@dadoonet

Agree with you.

Thanks

---

<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:** [September 3, 2019, 3:58pm UTC](https://discuss.elastic.co/t/how-to-get-the-best-performance-with-index-update/193776/8 "2019-09-03T15:58:06Z")

</div>

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