doc-exports/docs/css/umn/css_02_0041.html
Zheng, Xiu 5b5876528a CSS UMN 22.5.1 Version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Zheng, Xiu <zhengxiu@huawei.com>
Co-committed-by: Zheng, Xiu <zhengxiu@huawei.com>
2023-03-29 17:17:49 +00:00

26 lines
1.9 KiB
HTML

<a name="css_02_0041"></a><a name="css_02_0041"></a>
<h1 class="topictitle1">What Data Compression Algorithms Does CSS Use?</h1>
<div id="body0000001334841661"><p id="css_02_0041__p354513384513">CSS supports two data compression algorithms: LZ4 (by default) and best_compression.</p>
<ul id="css_02_0041__ul135452313450"><li id="css_02_0041__li1954563114511"><strong id="css_02_0041__b184358483444">LZ4 algorithm</strong><p id="css_02_0041__p12545143164519">LZ4 is the default compression algorithm of Elasticsearch. This algorithm can compress and decompress data quickly, but its compression ratio is low.</p>
<p id="css_02_0041__p95451037458">LZ4 scans data with a 4-byte window, which slides 1 byte forward at a time. Duplicate data is compressed. This algorithm applies to scenarios where a large amount of data to be read while a small amount of data to be written. </p>
</li><li id="css_02_0041__li1654513104510"><strong id="css_02_0041__b94081011339">best_compression algorithm</strong><p id="css_02_0041__p754512364513">This algorithm can be used when a large amount of data is written and the index storage cost is high, such as logs and time sequence analysis. This algorithm can greatly reduce the index storage cost.</p>
</li></ul>
<div class="p" id="css_02_0041__p1754513364515">Run the following command to switch the default compression algorithm (LZ4) to best_compression:<pre class="screen" id="css_02_0041__screen1554517314457">PUT index-1
{
"settings": {
"index": {
"codec": "best_compression"
}
}
}</pre>
</div>
<p id="css_02_0041__p175450384511">The LZ4 algorithm can quickly compress and decompress data while the best_compression algorithm has a higher compression and decompression ratio.</p>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="css_02_0051_0.html">General Consulting</a></div>
</div>
</div>