pub struct PartitionConfig {
pub shard_count: u16,
pub segment_max_bytes: usize,
pub use_meta: bool,
}Expand description
Configuration for partitioned tables.
This structure defines how data is distributed across shards and segments, providing control over write amplification and read performance.
Fields§
§shard_count: u16Number of shards to distribute writes across
Higher values spread writes better for hot keys but increase read fanout. Must be between 1 and 65535.
segment_max_bytes: usizeMaximum size in bytes for a single segment before rolling
When a segment exceeds this size, a new segment is created. This controls write amplification - smaller segments rewrite less data but increase read overhead.
use_meta: boolWhether to use a meta table for O(1) head segment discovery
With meta: Faster writes, additional storage overhead Without meta: Simpler, but requires scanning to find writable segment
Implementations§
Trait Implementations§
Source§impl Clone for PartitionConfig
impl Clone for PartitionConfig
Source§fn clone(&self) -> PartitionConfig
fn clone(&self) -> PartitionConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PartitionConfig
impl Debug for PartitionConfig
Auto Trait Implementations§
impl Freeze for PartitionConfig
impl RefUnwindSafe for PartitionConfig
impl Send for PartitionConfig
impl Sync for PartitionConfig
impl Unpin for PartitionConfig
impl UnwindSafe for PartitionConfig
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