# Performance tuning in elastic search in application level joins

**URL:** <https://discuss.elastic.co/t/performance-tuning-in-elastic-search-in-application-level-joins/344788>\
**Category:** Elasticsearch\
**Created:** [October 11, 2023, 6:26am UTC](https://discuss.elastic.co/t/performance-tuning-in-elastic-search-in-application-level-joins/344788 "2023-10-11T06:26:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![yash\_gehi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yash_gehi/32/126247_2.png) [@yash\_gehi](https://discuss.elastic.co/u/yash_gehi)\
**Post date:** [October 11, 2023, 6:26am UTC](https://discuss.elastic.co/t/performance-tuning-in-elastic-search-in-application-level-joins/344788/1 "2023-10-11T06:26:03Z")

</div>

- I have 2 tables which I have to join based on 3 common keys I'm trying for application level joins

- But it is getting more time in execution and dataset size is kind of large around 3-4 million

- Can you tell me how can I improve the performance of this?

- The purpose of me using Elasticsearch is for faster search and faster match\_phrase query result

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [October 11, 2023, 6:30am UTC](https://discuss.elastic.co/t/performance-tuning-in-elastic-search-in-application-level-joins/344788/2 "2023-10-11T06:30:08Z")

</div>

A common way to improve performance is to denormalise the data model in order to avoid any kind of joins. How this is done will naturally depend on the nature and size of the data as well as how frequently the different types of data are added, deleted and/or updated.

---

<div class="post-metadata">

**Author:** ![yash\_gehi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yash_gehi/32/126247_2.png) [@yash\_gehi](https://discuss.elastic.co/u/yash_gehi)\
**Post date:** [October 11, 2023, 6:32am UTC](https://discuss.elastic.co/t/performance-tuning-in-elastic-search-in-application-level-joins/344788/3 "2023-10-11T06:32:45Z")

</div>

data size is large for . In denormalisation if there is a change in data in my normal table I have to make changes to the denormalised table also right?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [October 11, 2023, 6:42am UTC](https://discuss.elastic.co/t/performance-tuning-in-elastic-search-in-application-level-joins/344788/4 "2023-10-11T06:42:46Z")

</div>

What are the sizes of the two indices in terms of documents and GB? What is the type of data in the two indices? What is the average size of the documents in the two indices? How often are documents in the two indices updated?

---

<div class="post-metadata">

**Author:** ![yash\_gehi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yash_gehi/32/126247_2.png) [@yash\_gehi](https://discuss.elastic.co/u/yash_gehi)\
**Post date:** [October 11, 2023, 7:17am UTC](https://discuss.elastic.co/t/performance-tuning-in-elastic-search-in-application-level-joins/344788/5 "2023-10-11T07:17:35Z")

</div>

1 table is having around 0.67 gb data and other table is having around 0.24 gb data. the change will be kind of often. 1 table contains the data of user and their entitlements (like manager, representative). other contains the transactions which the user based on entitlements can see.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [October 11, 2023, 7:20am UTC](https://discuss.elastic.co/t/performance-tuning-in-elastic-search-in-application-level-joins/344788/6 "2023-10-11T07:20:55Z")

</div>

If you want to optimise query performance you often have to instead to more work when updating data. As those tables/indices are very small I would recommend denormalising the data if search performance is important.

---

<div class="post-metadata">

**Author:** ![yash\_gehi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yash_gehi/32/126247_2.png) [@yash\_gehi](https://discuss.elastic.co/u/yash_gehi)\
**Post date:** [October 12, 2023, 8:30am UTC](https://discuss.elastic.co/t/performance-tuning-in-elastic-search-in-application-level-joins/344788/7 "2023-10-12T08:30:02Z")

</div>

Hi can we connect? ig then I will be explain you more exactly what I'm trying to achieve

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [October 12, 2023, 8:47am UTC](https://discuss.elastic.co/t/performance-tuning-in-elastic-search-in-application-level-joins/344788/8 "2023-10-12T08:47:04Z")

</div>

Please explain it here so the community can benefit.

---

<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:** [November 9, 2023, 8:47am UTC](https://discuss.elastic.co/t/performance-tuning-in-elastic-search-in-application-level-joins/344788/9 "2023-11-09T08:47:34Z")

</div>

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