pub struct BlockStats {
pub min: f64,
pub max: f64,
pub null_count: u32,
pub row_count: u32,
pub str_min: Option<String>,
pub str_max: Option<String>,
pub bloom: Option<BloomFilter>,
pub min_i64: Option<i64>,
pub max_i64: Option<i64>,
}Expand description
Per-block statistics for a single column. Enables predicate pushdown:
skip blocks where WHERE price > 100 and block’s max_price < 100.
Fields§
§min: f64Minimum value in this block (encoded as f64 for uniformity; i64 values are cast losslessly for small values; strings use NaN).
For i64/timestamp columns, prefer min_i64 when available — f64 cannot
represent all i64 values exactly (values outside ±2^53 may be rounded).
max: f64Maximum value in this block (see min for caveats on i64 precision).
null_count: u32Number of null values in this block.
row_count: u32Number of rows in this block (≤ BLOCK_SIZE, last block may be smaller).
str_min: Option<String>Lexicographic minimum for string columns (truncated to 32 bytes).
None for numeric, bool, binary, vector, and other non-string columns.
str_max: Option<String>Lexicographic maximum for string columns (truncated to 32 bytes).
None for non-string columns.
bloom: Option<BloomFilter>Bloom filter for equality-predicate skipping on string columns.
Carries the filter parameters (k, m) alongside the bytes so that
readers never depend on compile-time constants to interpret the filter.
None when there are no non-null string values in the block, or when
cardinality is too low to justify the overhead.
min_i64: Option<i64>Exact integer minimum for i64/timestamp columns.
Set alongside min (which holds the lossy f64 cast) so that predicates
with integral values outside ±2^53 can compare losslessly. None for
all non-integer column types and for segments written before minor v1.
max_i64: Option<i64>Exact integer maximum for i64/timestamp columns (see min_i64).
Implementations§
Source§impl BlockStats
impl BlockStats
Sourcepub fn numeric(min: f64, max: f64, null_count: u32, row_count: u32) -> Self
pub fn numeric(min: f64, max: f64, null_count: u32, row_count: u32) -> Self
Create stats for a numeric block with known min/max.
Sourcepub fn integer(min: i64, max: i64, null_count: u32, row_count: u32) -> Self
pub fn integer(min: i64, max: i64, null_count: u32, row_count: u32) -> Self
Create stats for an i64 or timestamp column block.
Populates both the lossless min_i64/max_i64 fields AND the lossy
min/max f64 fields so that the f64 path remains a valid fallback
for non-integral predicate values.
Sourcepub fn non_numeric(null_count: u32, row_count: u32) -> Self
pub fn non_numeric(null_count: u32, row_count: u32) -> Self
Create stats for a block with no meaningful numeric min/max (non-numeric columns).
Sourcepub fn string_block(
null_count: u32,
row_count: u32,
str_min: Option<String>,
str_max: Option<String>,
bloom: Option<BloomFilter>,
) -> Self
pub fn string_block( null_count: u32, row_count: u32, str_min: Option<String>, str_max: Option<String>, bloom: Option<BloomFilter>, ) -> Self
Create stats for a string block with lexicographic bounds and bloom filter.
Trait Implementations§
Source§impl Clone for BlockStats
impl Clone for BlockStats
Source§fn clone(&self) -> BlockStats
fn clone(&self) -> BlockStats
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BlockStats
impl Debug for BlockStats
Source§impl<'de> Deserialize<'de> for BlockStats
impl<'de> Deserialize<'de> for BlockStats
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<'__msgpack_de> FromMessagePack<'__msgpack_de> for BlockStats
impl<'__msgpack_de> FromMessagePack<'__msgpack_de> for BlockStats
Source§impl Serialize for BlockStats
impl Serialize for BlockStats
Auto Trait Implementations§
impl Freeze for BlockStats
impl RefUnwindSafe for BlockStats
impl Send for BlockStats
impl Sync for BlockStats
impl Unpin for BlockStats
impl UnsafeUnpin for BlockStats
impl UnwindSafe for BlockStats
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.