# How to avoid large index update

**URL:** <https://discuss.elastic.co/t/how-to-avoid-large-index-update/166262>\
**Category:** Elasticsearch\
**Created:** [January 30, 2019, 6:05am UTC](https://discuss.elastic.co/t/how-to-avoid-large-index-update/166262 "2019-01-30T06:05:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![adithsukumar](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@adithsukumar](https://discuss.elastic.co/u/adithsukumar)\
**Post date:** [January 30, 2019, 6:05am UTC](https://discuss.elastic.co/t/how-to-avoid-large-index-update/166262/1 "2019-01-30T06:05:21Z")

</div>

Hi All  
We are trying to sync the relational data from mssql database to ES index. The structure of my sql data base is like this:

- Teacher table - teacher\_id , teacher\_name
- Course table- course\_id , course\_name, teacher\_id
- Doubts table- doubt\_id , doubt, course id, teacher\_id

We have mapped the index in a denormalized way to get the results quickly(ie instead of teacher\_id we are keeping the teacher\_name in the index). The current index structure as below :  
{  
doubt: '',  
course\_name: '',  
teacher\_name: ''  
}

This index contains millions of documents. When the data in teacher or course master table in sql database changes, it is taking a long time to update the index.  
Is there any better way to update the index quickly? Is it possible to split the data into different indices and get the required output by joining the different indices ?

Appreciate your valuable suggestions.

---

<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:** [January 30, 2019, 6:59am UTC](https://discuss.elastic.co/t/how-to-avoid-large-index-update/166262/2 "2019-01-30T06:59:49Z")

</div>

Are you using the `_bulk` API?

---

<div class="post-metadata">

**Author:** ![adithsukumar](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@adithsukumar](https://discuss.elastic.co/u/adithsukumar)\
**Post date:** [January 30, 2019, 11:23am UTC](https://discuss.elastic.co/t/how-to-avoid-large-index-update/166262/3 "2019-01-30T11:23:30Z")

</div>

we tried \_bulk api but it is time consuming

---

<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:** [January 30, 2019, 11:27am UTC](https://discuss.elastic.co/t/how-to-avoid-large-index-update/166262/4 "2019-01-30T11:27:18Z")

</div>

What do you mean by that?

---

<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 27, 2019, 11:27am UTC](https://discuss.elastic.co/t/how-to-avoid-large-index-update/166262/5 "2019-02-27T11:27:18Z")

</div>

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