pub(crate) enum SubBatchStrategy {
Values(usize),
Levels(usize),
}Expand description
How write_granular_chunk should cut mini-batch windows in one chunk.
Cutting on exact value counts is the precise option and the expensive one: it roughly doubles the number of mini-batches on a nullable column, because the level:value ratio no longer rounds a window up to cover a second value. It is used only where that precision buys something.
Variants§
Values(usize)
Cut after exactly this many values, walking definition levels to find the boundary.
Used against the data page budget for encodings that compress a value against its predecessor, where the round-up below costs whole values of output: 16 MiB rather than 2 MiB for 128 values at one null in 16. See #10538 for the measurements.
Levels(usize)
Cut after this many levels: the value budget scaled by the chunk’s level:value ratio, rounded up.
Used everywhere else, because everywhere else the round-up changes no
bytes — the dictionary page budget shrinks toward zero as the
dictionary fills, so a one-value budget is routine there for ordinary
values, and PLAIN and DELTA_LENGTH_BYTE_ARRAY values cost the same
wherever they land — while value-exact windows cost throughput
(#10554).
The round-up is bounded, which is what makes it an acceptable price. A
window spans ceil(values * levels / values_in_chunk) levels, so where
one value already fills the budget it covers at most two values,
whatever the null density. The page bound #9972 added therefore still
holds; it is two values per page rather than one.
Trait Implementations§
Source§impl Clone for SubBatchStrategy
impl Clone for SubBatchStrategy
Source§fn clone(&self) -> SubBatchStrategy
fn clone(&self) -> SubBatchStrategy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SubBatchStrategy
Source§impl Debug for SubBatchStrategy
impl Debug for SubBatchStrategy
impl Eq for SubBatchStrategy
Source§impl PartialEq for SubBatchStrategy
impl PartialEq for SubBatchStrategy
impl StructuralPartialEq for SubBatchStrategy
Auto Trait Implementations§
impl Freeze for SubBatchStrategy
impl RefUnwindSafe for SubBatchStrategy
impl Send for SubBatchStrategy
impl Sync for SubBatchStrategy
impl Unpin for SubBatchStrategy
impl UnsafeUnpin for SubBatchStrategy
impl UnwindSafe for SubBatchStrategy
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.