# Chaining queries with rally

**URL:** <https://discuss.elastic.co/t/chaining-queries-with-rally/340525>\
**Category:** Elasticsearch\
**Tags:** rally\
**Created:** [August 10, 2023, 8:22am UTC](https://discuss.elastic.co/t/chaining-queries-with-rally/340525 "2023-08-10T08:22:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gustavo\_Llermaly](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gustavo_llermaly/32/92019_2.png) [@Gustavo\_Llermaly](https://discuss.elastic.co/u/Gustavo_Llermaly)\
**Post date:** [August 10, 2023, 8:22am UTC](https://discuss.elastic.co/t/chaining-queries-with-rally/340525/1 "2023-08-10T08:22:08Z")

</div>

Hi ,

What's the best practice to benchmark an application side joins scenario?

Meaning running an initial query with "collapse" to group by some id, take all the ids from the response and run a second "terms" query?

What I'm doing is creating a new es Client instance on the track.py file but doesnt look good and runs very slow.

Thanks

---

<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:** [September 7, 2023, 8:22am UTC](https://discuss.elastic.co/t/chaining-queries-with-rally/340525/2 "2023-09-07T08:22:24Z")

</div>

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