Impact of data compression on performance

更新时间:
复制 MD 格式

Enabling compression for fields, attributes, and indexes reduces storage space but degrades query performance. Evaluate the trade-off before enabling compression in production.

What not to compress

Avoid enabling compression on the following:

  • Frequently accessed indexes, fields, or attributes — decompression overhead accumulates with every query hit.

  • Hot spot fields — fields with concentrated access patterns amplify the performance cost of decompression.

Test before enabling in production

Before changing your online cluster, validate the impact in a test cluster:

  1. Enable data compression in the test cluster.

  2. Run representative queries and monitor the following metrics:

    • Query response time

    • Cluster load

  3. If the impact is acceptable for your workload, enable compression on your online cluster.

Reduce the performance impact with cache

After enabling compression, configure an index table loading policy to cache decompressed data in memory. This reduces the decompression overhead on repeated queries.

In the cache policy, add the following parameter to the load_strategy_param section in load_config:

"cache_decompress_file": true
ParameterTypeValueDescription
cache_decompress_fileBooleantrueCaches decompressed data. Set to true when data compression is enabled to reduce query latency.

For the full configuration procedure, see Configure an index table loading policy.