# Questions about Named Queries

**URL:** <https://discuss.elastic.co/t/questions-about-named-queries/56662>\
**Category:** Elasticsearch\
**Created:** [July 28, 2016, 6:00pm UTC](https://discuss.elastic.co/t/questions-about-named-queries/56662 "2016-07-28T18:00:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonusko](https://avatars.discourse-cdn.com/v4/letter/j/3e96dc/32.png) [@jonusko](https://discuss.elastic.co/u/jonusko)\
**Post date:** [July 28, 2016, 6:00pm UTC](https://discuss.elastic.co/t/questions-about-named-queries/56662/1 "2016-07-28T18:00:42Z")

</div>

I have a few questions around Named Queries that I don't see documented:

1. What is the maximum length allowed for a Named Query "\_name" field?
2. Do long names have any performance impact other than the matched\_query results are larger?
3. Besides escaping double quotes, is there any character limitations for a name?

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [July 28, 2016, 6:22pm UTC](https://discuss.elastic.co/t/questions-about-named-queries/56662/2 "2016-07-28T18:22:41Z")

</div>

> [@jonusko](#):
>
> What is the maximum length allowed for a Named Query "\_name" field?

I'd be fairly surprised if there was a maximum allowed length. I can't see one digging around in the code.

> [@jonusko](#):
>
> Do long names have any performance impact other than the matched\_query results are larger?

Not really. They take up a bit more room in the heap and they hash a tiny bit slower but overall I don't think you'll notice anything unless you are intentionally making the names many kilobytes. They are just java strings internally.

> [@jonusko](#):
>
> Besides escaping double quotes, is there any character limitations for a name?

Not that I can see from the code.

---

<div class="post-metadata">

**Author:** ![jonusko](https://avatars.discourse-cdn.com/v4/letter/j/3e96dc/32.png) [@jonusko](https://discuss.elastic.co/u/jonusko)\
**Post date:** [July 28, 2016, 8:06pm UTC](https://discuss.elastic.co/t/questions-about-named-queries/56662/3 "2016-07-28T20:06:09Z")

</div>

Sounds good. 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:** [July 5, 2017, 10:31pm UTC](https://discuss.elastic.co/t/questions-about-named-queries/56662/4 "2017-07-05T22:31:58Z")

</div>


