# Does document ID length affect performance/heap?

**URL:** <https://discuss.elastic.co/t/does-document-id-length-affect-performance-heap/166965>\
**Category:** Elasticsearch\
**Created:** [February 4, 2019, 1:32pm UTC](https://discuss.elastic.co/t/does-document-id-length-affect-performance-heap/166965 "2019-02-04T13:32:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gskema](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gskema/32/13648_2.png) [@gskema](https://discuss.elastic.co/u/gskema)\
**Post date:** [February 4, 2019, 1:32pm UTC](https://discuss.elastic.co/t/does-document-id-length-affect-performance-heap/166965/1 "2019-02-04T13:32:51Z")

</div>

Let's say we have 300 million documents. An average document ID looks like this:  
**aaaaaaaaaaaaaaaa\_000000000\_0\_0\_0\_0**

There are thousands of MGET operations every second for these documents.  
We wanted to change the document ID to make it more readable, but our colleague says that the IDs are already too long and should be shorter because length affects performance and heap usage.

Is that true? Is there a resource where we could learn more about it. Thank You

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [February 4, 2019, 4:36pm UTC](https://discuss.elastic.co/t/does-document-id-length-affect-performance-heap/166965/2 "2019-02-04T16:36:08Z")

</div>

The structure of document IDs do indeed affect heap usage. We started to investigate some alternatives to the auto-generated IDs that Elasticsearch creates if you don't give an explicit ID here:

> <https://github.com/elastic/elasticsearch/issues/33049>

It's not purely a function of length, because the changes discussed in that thread are not affecting the lengths of the IDs. As with all performance questions there is no substitute for careful benchmarking to determine the true effects of any change.

---

<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 4, 2019, 4:36pm UTC](https://discuss.elastic.co/t/does-document-id-length-affect-performance-heap/166965/3 "2019-03-04T16:36:17Z")

</div>

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