pub struct UniversalCompactionOptions {
pub size_ratio: u32,
pub min_merge_width: u32,
pub max_merge_width: u32,
pub max_size_amplification_percent: u32,
}Expand description
Tunables for CompactionStyle::Universal. Ignored when the
style is not CompactionStyle::Universal.
Fields§
§size_ratio: u32Percent tolerance used by the size-ratio merge rule. Walk
the L0 files newest-first; accumulate files while the
running total is within size_ratio percent of the next
candidate’s size. When the accumulator hits
UniversalCompactionOptions::min_merge_width files, the
picker merges them into one new L0 file. A larger
size_ratio groups more files per merge (lower write
amplification, larger output); smaller is pickier. Must be
greater than zero when universal compaction is selected.
Default: 1 (percent).
min_merge_width: u32Smallest number of files the size-ratio rule is willing to
merge. Must be at least 2 when universal compaction is
selected. Pass 2 for the most aggressive grouping.
Default: 2.
max_merge_width: u32Cap on the number of files a single size-ratio merge can
consume. Must be >= UniversalCompactionOptions::min_merge_width
when universal compaction is selected. u32::MAX disables
the cap. Default: u32::MAX.
max_size_amplification_percent: u32Size-amplification trigger, as a percent. When
total_size_of_all_older_files * 100 / size_of_oldest_file
exceeds this value, the picker forces a full merge of
every L0 file into one run. Default: 200 (i.e., full merge
fires once the accumulated non-oldest content is ~2× the
oldest run). Must be greater than zero when universal
compaction is selected.
Trait Implementations§
Source§impl Clone for UniversalCompactionOptions
impl Clone for UniversalCompactionOptions
Source§fn clone(&self) -> UniversalCompactionOptions
fn clone(&self) -> UniversalCompactionOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more