pub struct Leveled { /* private fields */ }Expand description
Levelled compaction strategy (LCS)
When a level reaches some threshold size, parts of it are merged into overlapping tables in the next level.
Each level Ln for n >= 2 can have up to level_base_size * ratio^(n - 1) tables.
LCS suffers from comparatively high write amplification, but has decent read amplification and great space amplification (~1.1x).
LCS is the recommended compaction strategy to use.
More info here: https://fjall-rs.github.io/post/lsm-leveling/
Implementations§
Source§impl Strategy
impl Strategy
Sourcepub fn with_level_ratio_policy(self, policy: Vec<f32>) -> Self
pub fn with_level_ratio_policy(self, policy: Vec<f32>) -> Self
Sets the growth ratio between levels.
Default = 10.0
Sourcepub fn with_l0_threshold(self, threshold: u8) -> Self
pub fn with_l0_threshold(self, threshold: u8) -> Self
Sets the L0 threshold.
Default = 4
Sourcepub fn with_table_target_size(self, bytes: u64) -> Self
pub fn with_table_target_size(self, bytes: u64) -> Self
Sets the table target size.
Default = 64 MiB
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Strategy
impl RefUnwindSafe for Strategy
impl Send for Strategy
impl Sync for Strategy
impl Unpin for Strategy
impl UnwindSafe for Strategy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more