Subproperties of compaction

Constructing a map of the compaction property and its subproperties.

Using CQL, you can configure compaction for a table by constructing a map of the compaction property and the following subproperties:

CQL Compaction Subproperties
Compaction Subproperties Description Default Supported Strategy
bucket_high Size-tiered compaction strategy (STCS) considers SSTables to be within the same bucket if the SSTable size diverges by 50% or less from the default bucket_low and default bucket_high values: [average-size × bucket_low, average-size × bucket_high]. 1.5 STCS
bucket_low Same as above. 0.5 STCS
max_threshold In SizeTieredCompactionStrategy, sets the maximum number of SSTables to allow in a minor compaction. In LeveledCompactionStrategy, it applies to L0 when L0 gets behind, that is, when L0 accumulates more than MAX_COMPACTING_L0 SSTables. 32 STCS
min_threshold In SizeTieredCompactionStrategy sets the minimum number of SSTables to trigger a minor compaction. 4 STCS
min_sstable_size The SizeTieredCompactionStrategy groups SSTables for compaction into buckets. The bucketing process groups SSTables that differ in size by less than 50%. This results in a bucketing process that is too fine grained for small SSTables. If your SSTables are small, use min_sstable_size to define a size threshold (in bytes) below which all SSTables belong to one unique bucket. 50MB STCS
sstable_size_in_mb The target size for SSTables that use the leveled compaction strategy (LCS). Although SSTable sizes should be less or equal to sstable_size_in_mb, it is possible to have a larger SSTable during compaction. This occurs when data for a given partition key is exceptionally large. The data is not split into two SSTables. 160MB LCS
tombstone_compaction_interval The minimum time to wait after an SSTable creation time before considering the SSTable for tombstone compaction. Tombstone compaction is the compaction triggered if the SSTable has more garbage-collectable tombstones than tombstone_threshold. 1 day all
tombstone_threshold A ratio of garbage-collectable tombstones to all contained columns, which if exceeded by the SSTable triggers compaction (with no other SSTables) for the purpose of purging the tombstones. 0.2 all

To disable background compactions, use nodetool disableautocompaction/enableautocompaction instead of setting min/max compaction thresholds to 0.