# SimpleIdCache question

**URL:** <https://discuss.elastic.co/t/simpleidcache-question/9423>\
**Category:** Elasticsearch\
**Created:** [October 19, 2012, 7:18pm UTC](https://discuss.elastic.co/t/simpleidcache-question/9423 "2012-10-19T19:18:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Serg\_Pilipenko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/serg_pilipenko/32/13833_2.png) [@Serg\_Pilipenko](https://discuss.elastic.co/u/Serg_Pilipenko)\
**Post date:** [October 19, 2012, 7:18pm UTC](https://discuss.elastic.co/t/simpleidcache-question/9423/1 "2012-10-19T19:18:22Z")

</div>

From doc I've read that  
With the current implementation, all \_id values are loaded to memory (heap)  
in order to support fast lookups, so make sure there is enough mem for it.  
So I hope that this implementation will be improved. It will be great  
if SimpleIdCache will obtain LRU behaviour. And if it will be filled by demand.  
I mean that if I have query with filer that should go through some \*filtered

- set of parent and child docs then _only_ this doc ids appended  
to SimpleIdCache but not _all_.

No announcements about improving this code?

--

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [October 20, 2012, 10:42pm UTC](https://discuss.elastic.co/t/simpleidcache-question/9423/2 "2012-10-20T22:42:40Z")

</div>

Yes, if you use the parent/child feature, the id values are loaded to memory in order to implement fast in memory joins. We might improve that to an LRU based behavior, but this solution scales very nicely by simply adding more nodes.

On Oct 19, 2012, at 9:18 PM, Serg Pilipenko [cloun.rules@gmail.com](mailto:cloun.rules@gmail.com) wrote:

> From doc I've read that  
> With the current implementation, all \_id values are loaded to memory (heap) in order to support fast lookups, so make sure there is enough mem for it.  
> So I hope that this implementation will be improved. It will be great if SimpleIdCache will obtain LRU behaviour. And if it will be filled by demand. I mean that if I have query with filer that should go through some filtered set of parent and child docs then only this doc ids appended to SimpleIdCache but not all.
> 
> No announcements about improving this code?
> 
> --

--

---

<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 6, 2017, 3:07am UTC](https://discuss.elastic.co/t/simpleidcache-question/9423/3 "2017-07-06T03:07:48Z")

</div>

Closed on July 6, 2017, 3:07am UTC


