# Multi-get vs Terms query performance

**URL:** <https://discuss.elastic.co/t/multi-get-vs-terms-query-performance/345241>\
**Category:** Elasticsearch\
**Created:** [October 17, 2023, 8:05pm UTC](https://discuss.elastic.co/t/multi-get-vs-terms-query-performance/345241 "2023-10-17T20:05:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CletusTSJY](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cletustsjy/32/20423_2.png) [@CletusTSJY](https://discuss.elastic.co/u/CletusTSJY)\
**Post date:** [October 17, 2023, 8:05pm UTC](https://discuss.elastic.co/t/multi-get-vs-terms-query-performance/345241/1 "2023-10-17T20:05:33Z")

</div>

I'm using Elasticsearch 7.16.2 and for one of my use-cases I need to fetch documents out of my Elasticsearch index in batches of 200 to 400 at a time. Each document is around 40k on disk but I only fetch certain fields, which cuts the document size in half.

I had implemented this as a "terms" query on a keyword field and the performance was ok but I thought a Multi-get would be faster because it could grab each document directly. However when I made the change to Multi-get, I saw my response times double in every percentile.

I'm wondering if there is an explanation for this or whether it is expected? And whether there is a way to evaluate where the bottlenecks are in my Multi-get request to make it faster?

---

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [October 18, 2023, 3:55pm UTC](https://discuss.elastic.co/t/multi-get-vs-terms-query-performance/345241/2 "2023-10-18T15:55:45Z")

</div>

Hi @CletusTSJY,

Have you tried running your query through the [search profiler](https://www.elastic.co/guide/en/kibana/7.16/xpack-profiler.html)? That could give you a good way of evaluating your queries

---

<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 15, 2023, 3:56pm UTC](https://discuss.elastic.co/t/multi-get-vs-terms-query-performance/345241/3 "2023-11-15T15:56:28Z")

</div>

Closed on November 15, 2023, 3:56pm UTC

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