# Parent-Child Relationship performance

**URL:** <https://discuss.elastic.co/t/parent-child-relationship-performance/301416>\
**Category:** Elasticsearch\
**Created:** [April 3, 2022, 8:17am UTC](https://discuss.elastic.co/t/parent-child-relationship-performance/301416 "2022-04-03T08:17:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanders\_2345](https://avatars.discourse-cdn.com/v4/letter/s/a88e57/32.png) [@sanders\_2345](https://discuss.elastic.co/u/sanders_2345)\
**Post date:** [April 3, 2022, 8:17am UTC](https://discuss.elastic.co/t/parent-child-relationship-performance/301416/1 "2022-04-03T08:17:16Z")

</div>

We've one usecase to implement where we want to maintain a relationship between two types of documents. We tried to put in the same document but the document size exceeding 200kb. So we're exploring parent-child relation model, where 1parent will map to 1 child. Read through the documentation regarding the performance issue when using the joins, but want to check any room for more improvement here.

Es version - 7.12  
Cluster - 250+ mn document parent & 250+ mn child  
200+ shards, writes are not frequent, mostly read-only cluster.  
After indexing, field data is size 2gb, single query with has\_child is taking almost 2.5 - 5 secs.

\_stats/fielddata?human&fields=join\_field#parent

```auto
primaries: {
 fielddata:{
   memory_size: "2.1gb",
   memory_size_in_bytes: 2309747432
 }
}

```

Is there a way to improve these metrics?

---

<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:** [May 1, 2022, 8:18am UTC](https://discuss.elastic.co/t/parent-child-relationship-performance/301416/2 "2022-05-01T08:18:11Z")

</div>

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