# Is there any performance comparison between the default index codec and best\_compression?

**URL:** <https://discuss.elastic.co/t/is-there-any-performance-comparison-between-the-default-index-codec-and-best-compression/340312>\
**Category:** Elasticsearch\
**Created:** [August 8, 2023, 3:17am UTC](https://discuss.elastic.co/t/is-there-any-performance-comparison-between-the-default-index-codec-and-best-compression/340312 "2023-08-08T03:17:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [August 8, 2023, 3:17am UTC](https://discuss.elastic.co/t/is-there-any-performance-comparison-between-the-default-index-codec-and-best-compression/340312/1 "2023-08-08T03:17:18Z")

</div>

Hello,

I'm looking into ways to optimize the disk usage of my indices on my cluster and before go on the route to remove the `_source` field I've decided to try and change the index codec to `best_compression`.

The [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.7/index-modules.html#index-modules-settings) mentions that `best_compression` provides a higher compression rate **_at the expense of slower stored fields performance_**.

But, is there any performance comparison between `default` and `best_compression` published by Elastic? Is this still relevant after the many improvements on indexing/storage made in the last versions?

While the default codec for manually created indices are the `default` value, which uses LZ4, it seems that the data streams and backing indices created by Elastic Agent uses `best_compression` as the default codec per these [template settings](https://github.com/elastic/elasticsearch/blob/main/x-pack/plugin/core/template-resources/src/main/resources/logs-settings.json) for example.

So, it is safe to assume that if there is any performance impact it will not be something very noticeable in most of the cases?

---

<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:** [September 5, 2023, 3:17am UTC](https://discuss.elastic.co/t/is-there-any-performance-comparison-between-the-default-index-codec-and-best-compression/340312/2 "2023-09-05T03:17:29Z")

</div>

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