Deep write optimization

更新时间:
复制 MD 格式

Alibaba Cloud Elasticsearch Serverless (ES Serverless) applies the best practices and kernel optimization features of Alibaba Cloud ES to indexes in log analysis applications. This improves read and write performance and reduces storage costs for log scenarios. Some of these features may affect how you use your indexes, which is why the deep write optimization feature is provided. If these features do not affect your business, you can enable this feature to gain further benefits in log scenarios.

Index adjustments

When deep write optimization is enabled, the following adjustments are made to the index:

  • The Text field type is changed to match_only_text, that is, "type": "match_only_text".

  • The term_hash feature is enabled for both Text and keyword types, that is, "term_hash_enable": true.

  • Dynamically added string field types are set to match_only_text and the term_hash feature is enabled.

Feature impacts and benefits

match_only_text

Note

The match_only_text field type was introduced in Elasticsearch version 7.14. For more information, see match-only-text-field-type.

Impacts:

  • The performance of queries that use positions, such as match_phrase, is affected.

  • Span queries are not supported. You can use interval queries instead of span queries.

Benefit: Saves about 10% of disk space for log datasets.

TermHash

The TermHash feature reduces index building overhead by replacing the native Elasticsearch Finite State Transducer (FST) with a hash structure.

Impact: Prefix queries, such as prefix and match_phrase_prefix queries, are not supported.

Benefits: Reduces index size by about 10% and improves write performance by 20% to 30%.

Recommendations

  • Enable deep write optimization at the application level.

    You can set this option when you create an index or adjust the configuration on the application's Application Details page. For more information, see Create a log analysis application.

  • Decide whether to enable deep write optimization for an index on a case-by-case basis. If the features described above do not affect your business, you can enable this optimization for the index.

    By default, an index created in an application uses the application-level configuration. To change the index configuration, you can modify the settings in the advanced configuration for the index. For more information, see Create an index and Modify an index configuration.