Indexing fees account for a large proportion of the cost of Log Service. You can save indexing fees to save the cost.

You can use one of the following methods to save indexing fees as needed:

Disable full-text indexing

You can disable full-text indexing and specify the key value during queries to save the cost.

Log Service supports full-text indexing and field indexing. For more information, see index types in Overview. Full-text indexing creates an index of the text type on all fields of a log. The key and value are used as normal text during queries. For fields of the long or double type, the key length is not included in indexing. If full-text indexing is enabled, the key and value are stored as text, and the key length is included in indexing. Therefore, the traffic of field indexing is lower than that of full-text indexing.

Disable LogReduce

You can disable Use LogReduce to group log data to save the indexing cost.

After LogReduce is enabled, the size of indexes increases by 10% of that of raw logs. For example, if the size of raw log data is 100 GB/day, the size of log indexes increases by 10 GB after you enable LogReduce.
Raw log size Index percentage Size of indexes generated by LogReduce Index size
100 GB 20% (20 GB) 100 × 10% 30 GB
100 GB 40% (40 GB) 100 × 10% 50 GB
100 GB 100% (100 GB) 100 × 10% 110 GB

Create indexes only on key fields

You can create indexes only on key fields to save the traffic and storage cost.

If a large amount of data is recorded in the raw log, some fields are not used for query and analysis. Therefore, you do not need to create indexes on these fields.