# Deduplication - Nested, Parent/Child OR None

**URL:** <https://discuss.elastic.co/t/deduplication-nested-parent-child-or-none/24942>\
**Category:** Elasticsearch\
**Created:** [July 6, 2015, 11:20am UTC](https://discuss.elastic.co/t/deduplication-nested-parent-child-or-none/24942 "2015-07-06T11:20:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mosiddi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mosiddi/32/577_2.png) [@mosiddi](https://discuss.elastic.co/u/mosiddi)\
**Post date:** [July 6, 2015, 11:20am UTC](https://discuss.elastic.co/t/deduplication-nested-parent-child-or-none/24942/1 "2015-07-06T11:20:10Z")

</div>

Hi there,  
We have a scenario where the documents we index might be present at multiple folders with same content. at indexing time, we can easily detect these duplicate as we have content hash. the duplication factors sometimes we see is \>20. We don't store \_source and we store only a few fields.

In normal cases (no duplicates) the size of index is reasonable. When we move to nested OR parent child and start storing \_source the size grows \>5 times and the query performance also slows down.

Say, for time, we don't care much about # of documents in index / size of index, doing no duplication and storing redundant data in ES is fine when compare to taking one of nested/ parent-child approach?

P.S. Our overall document size is way more than the stored fields size.

Regards,  
Imran

---

<div class="post-metadata">

**Author:** ![mosiddi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mosiddi/32/577_2.png) [@mosiddi](https://discuss.elastic.co/u/mosiddi)\
**Post date:** [July 7, 2015, 10:32am UTC](https://discuss.elastic.co/t/deduplication-nested-parent-child-or-none/24942/2 "2015-07-07T10:32:34Z")

</div>

Some more data -

1. I tried using nested format and the query performance was 10x slower. The major change was in the format (mapping) and I started using \_source as I wanted to support upsert.
2. I tried using parent-child based format but there was a limitation - I had to fire more than one queries now. One for matching parents and next for related children for these parents.

---

<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:03am UTC](https://discuss.elastic.co/t/deduplication-nested-parent-child-or-none/24942/3 "2017-07-06T00:03:15Z")

</div>


