# Uncompressed DocValues

**URL:** <https://discuss.elastic.co/t/uncompressed-docvalues/168>\
**Category:** Elasticsearch\
**Created:** [May 5, 2015, 12:21am UTC](https://discuss.elastic.co/t/uncompressed-docvalues/168 "2015-05-05T00:21:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![chuck](https://avatars.discourse-cdn.com/v4/letter/c/8e7dd6/32.png) [@chuck](https://discuss.elastic.co/u/chuck)\
**Post date:** [May 5, 2015, 12:21am UTC](https://discuss.elastic.co/t/uncompressed-docvalues/168/1 "2015-05-05T00:21:23Z")

</div>

I'm running an aggregation heavy application. I have plenty of ram, and would like to improve terms aggregation performance on a field of "long" values. Is it possible to instruct ES to leave the doc values for this field uncompressed to improve performance (there is plenty of ram to hold the array)? Would this be of any benefit?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 5, 2015, 3:06am UTC](https://discuss.elastic.co/t/uncompressed-docvalues/168/2 "2015-05-05T03:06:17Z")

</div>

I don't think this would be much of an improvement.  
Reduced disk size means less data to read off disk which is a good thing, plus the overhead in CPU to expand that data is going to be negligible.

That said I don't think you can specify individual fields to remain uncompressed. The closest thing you want is the old field data representation that doc values replaced.

---

<div class="post-metadata">

**Author:** ![chuck](https://avatars.discourse-cdn.com/v4/letter/c/8e7dd6/32.png) [@chuck](https://discuss.elastic.co/u/chuck)\
**Post date:** [May 7, 2015, 11:53pm UTC](https://discuss.elastic.co/t/uncompressed-docvalues/168/3 "2015-05-07T23:53:10Z")

</div>

@warkolm Thanks. That make sense.

Is it still possible in any way to override the default Lucene codec for a field? If not a field, for the whole index? I can think of a few special cases where this might still be useful, but I get that it's a _use at your own risk_ kindof thing.

---

<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:** [May 8, 2015, 9:42am UTC](https://discuss.elastic.co/t/uncompressed-docvalues/168/4 "2015-05-08T09:42:33Z")

</div>

Note, there is a difference between the compression that happens by default for stored fields (\_source) by Lucene, and how it handles doc values. Doc values are not compressed where LZ4 is applied to them, they might be better represented on disk depending on the type (like numerics), but thats it.

---

<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:15am UTC](https://discuss.elastic.co/t/uncompressed-docvalues/168/5 "2017-07-06T00:15:05Z")

</div>


