# Does the length of join key in parent/child can effect the speed of queries?

**URL:** <https://discuss.elastic.co/t/does-the-length-of-join-key-in-parent-child-can-effect-the-speed-of-queries/168993>\
**Category:** Elasticsearch\
**Created:** [February 19, 2019, 10:26am UTC](https://discuss.elastic.co/t/does-the-length-of-join-key-in-parent-child-can-effect-the-speed-of-queries/168993 "2019-02-19T10:26:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sambodhi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sambodhi/32/33873_2.png) [@sambodhi](https://discuss.elastic.co/u/sambodhi)\
**Post date:** [February 19, 2019, 10:26am UTC](https://discuss.elastic.co/t/does-the-length-of-join-key-in-parent-child-can-effect-the-speed-of-queries/168993/1 "2019-02-19T10:26:29Z")

</div>

We are on elasticsearch 6, we are using parent/child joins and it is currently based on ids which are (like '7C9F1FBF-0ACF-473D-A8CE-343968E981F6'), wondering if the length of these id or changing them to number (like '1','2981') would have any impact on performance? Thank you

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [February 22, 2019, 9:17am UTC](https://discuss.elastic.co/t/does-the-length-of-join-key-in-parent-child-can-effect-the-speed-of-queries/168993/2 "2019-02-22T09:17:56Z")

</div>

The join is not performed on values themselves but on their ordinal, so the length of the join key shouldn't have a significant impact.

---

<div class="post-metadata">

**Author:** ![sambodhi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sambodhi/32/33873_2.png) [@sambodhi](https://discuss.elastic.co/u/sambodhi)\
**Post date:** [February 22, 2019, 1:42pm UTC](https://discuss.elastic.co/t/does-the-length-of-join-key-in-parent-child-can-effect-the-speed-of-queries/168993/3 "2019-02-22T13:42:14Z")

</div>

Thanks for the answer Adrien. Though it is interesting to see the amount of space it consumes is reduced by 3 times if I change the key from guid like string to integer! Which made me think is this if impact speed.

---

<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:** [March 22, 2019, 1:42pm UTC](https://discuss.elastic.co/t/does-the-length-of-join-key-in-parent-child-can-effect-the-speed-of-queries/168993/4 "2019-03-22T13:42:15Z")

</div>

Closed on March 22, 2019, 1:42pm UTC

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