Regarding index.codec

Hi Team,

Regarding compression in documentation it is mentioned as below,

Use best_compression

The _source and stored fields can easily take a non negligible amount of disk space. They can be compressed more aggressively by using the best_compression codec.

Q. Is the compression only applies to _source and stored fields and not on indexed fields?

As we know, by default, not all fields are stored and as per above statement, only _source and stored fields are compressed.

I am interested to know, is applying compression affects overall elasticsearch performance if its use case is searching data, running aggregation, running query etc..

Can we conclude that applying compression has no effect on query or aggregation performance as query and aggregation will be performed on indexed fields and not on _source fields.


It will have an impact as there is more CPU needed to decompress the data.

What that impact looks like will need testing based on your hardware, data and setup.

It needs CPU to decompress data but only on _source and stored fields right and not on indexed fields. As i said, not all fields are stored by default.

My question is about the indexed fields as on these fields we run queries, aggregation etc.. so does compression affects query performance any way?


I believe using the best_compression codec primarily adds load at indexing time. It does not affect queries much.

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