# Fielddata cache and doc values

**URL:** https://discuss.elastic.co/t/fielddata-cache-and-doc-values/21370
**Category:** Elasticsearch
**Created:** [December 23, 2014, 3:17pm UTC](https://discuss.elastic.co/t/fielddata-cache-and-doc-values/21370 "2014-12-23T15:17:16Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Han\_JU](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/han_ju/32/962_2.png) [@Han\_JU](https://discuss.elastic.co/u/Han_JU)
#### Post date: [December 23, 2014, 3:17pm UTC](https://discuss.elastic.co/t/fielddata-cache-and-doc-values/21370/1 "2014-12-23T15:17:16Z")

</div>

Hi,

We are reviewing our ElasticSearch setup & settings, here's a question on  
fielddata cache and usage of doc values.

Currently we set fielddata cache to be 30% of the heap size and we've  
enabled doc\_values for all fields that we want to sort or aggregate (except  
2 boolean fields).  
As I understand, doc values are a form of on disk cache of field data. So  
my questions is, by using doc values, can we reduce the memory fielddata  
cache size? Say to 10%, is it a good idea?

Thanks!

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/914962d7-66ca-467e-bd35-fe520317dda9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/914962d7-66ca-467e-bd35-fe520317dda9%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![vineeth\_mohan\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vineeth_mohan_2/32/747_2.png) [@vineeth\_mohan\_2](https://discuss.elastic.co/u/vineeth_mohan_2)
#### Post date: [December 23, 2014, 3:29pm UTC](https://discuss.elastic.co/t/fielddata-cache-and-doc-values/21370/2 "2014-12-23T15:29:24Z")

</div>

Hi ,

Yes , definitely doc values would be a better idea.  
As it is not 100% memory resident , it will give a lot better stability and  
memory optimization to the system.  
On the flip side, performance might go down to , say 10 to 15%.

Thanks  
Vineeth

On Tue, Dec 23, 2014 at 8:47 PM, Han JU [ju.han.felix@gmail.com](mailto:ju.han.felix@gmail.com) wrote:

> Hi,
> 
> We are reviewing our Elasticsearch setup & settings, here's a question on  
> fielddata cache and usage of doc values.
> 
> Currently we set fielddata cache to be 30% of the heap size and we've  
> enabled doc\_values for all fields that we want to sort or aggregate (except  
> 2 boolean fields).  
> As I understand, doc values are a form of on disk cache of field data. So  
> my questions is, by using doc values, can we reduce the memory fielddata  
> cache size? Say to 10%, is it a good idea?
> 
> Thanks!
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/914962d7-66ca-467e-bd35-fe520317dda9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/914962d7-66ca-467e-bd35-fe520317dda9%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/914962d7-66ca-467e-bd35-fe520317dda9%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/914962d7-66ca-467e-bd35-fe520317dda9%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGdPd5%3DXOZHcYj%2BZTGTuF%3DCmuDcvawObAxskS2N4CMBJ53RCwQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGdPd5%3DXOZHcYj%2BZTGTuF%3DCmuDcvawObAxskS2N4CMBJ53RCwQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:42am UTC](https://discuss.elastic.co/t/fielddata-cache-and-doc-values/21370/3 "2017-07-06T00:42:11Z")

</div>


