# Performance impact of "named-queries"

**URL:** <https://discuss.elastic.co/t/performance-impact-of-named-queries/355836>\
**Category:** Elasticsearch\
**Created:** [March 20, 2024, 5:19pm UTC](https://discuss.elastic.co/t/performance-impact-of-named-queries/355836 "2024-03-20T17:19:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alliswell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alliswell/32/117514_2.png) [@alliswell](https://discuss.elastic.co/u/alliswell)\
**Post date:** [March 20, 2024, 5:19pm UTC](https://discuss.elastic.co/t/performance-impact-of-named-queries/355836/1 "2024-03-20T17:19:04Z")

</div>

Hi Folks,

I was going through the documentation of [named-queries](https://www.elastic.co/guide/en/elasticsearch/reference/8.12/query-dsl-bool-query.html#named-queries).

In the document, it mentions the following:

```auto
This functionality reruns each named query on every hit in a search response. Typically, this adds a small overhead to a request. However, using computationally expensive named queries on a large number of hits may add significant overhead. For example, named queries in combination with a top_hits aggregation on many buckets may lead to longer response times.

```

I'm trying to understand the above warning message is referring to "named-query" or "named query with `include_named_queries_score`"?

---

<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:** [April 17, 2024, 5:19pm UTC](https://discuss.elastic.co/t/performance-impact-of-named-queries/355836/2 "2024-04-17T17:19:28Z")

</div>

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