# Partial updates of nested documents

**URL:** <https://discuss.elastic.co/t/partial-updates-of-nested-documents/90055>\
**Category:** Elasticsearch\
**Created:** [June 20, 2017, 8:05am UTC](https://discuss.elastic.co/t/partial-updates-of-nested-documents/90055 "2017-06-20T08:05:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amol\_Sonawane](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@Amol\_Sonawane](https://discuss.elastic.co/u/Amol_Sonawane)\
**Post date:** [June 20, 2017, 8:05am UTC](https://discuss.elastic.co/t/partial-updates-of-nested-documents/90055/1 "2017-06-20T08:05:34Z")

</div>

I would like to know how Elasticsearch handles partial updates of nested documents internally? If there is any update to nested documents, does it still reindex the complete parent document or smartly just updates the respective references in parent document? What is the performance impact of updating nested documents (partial updates)?

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [June 20, 2017, 8:24am UTC](https://discuss.elastic.co/t/partial-updates-of-nested-documents/90055/2 "2017-06-20T08:24:07Z")

</div>

Updates are expensive because it is a complete replacement of all elements.  
A partial update will read the whole JSON (root object and nested children) into memory, apply the change then delete the old root+nested Lucene docs and create new root+nested Lucene docs to replace them.

This is done to keep root and nested docs physically next to each other on-disk for optimal query speeds.

---

<div class="post-metadata">

**Author:** ![Amol\_Sonawane](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@Amol\_Sonawane](https://discuss.elastic.co/u/Amol_Sonawane)\
**Post date:** [June 23, 2017, 5:02am UTC](https://discuss.elastic.co/t/partial-updates-of-nested-documents/90055/3 "2017-06-23T05:02:40Z")

</div>

Thank you so much.

---

<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 21, 2017, 5:02am UTC](https://discuss.elastic.co/t/partial-updates-of-nested-documents/90055/4 "2017-07-21T05:02:42Z")

</div>

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