struct AttrPred<'a> {
op: Op,
strs: Option<(&'a [u32], Vec<bool>)>,
ints: Option<(&'a [i64], i64)>,
doubles: Option<(&'a [f64], f64)>,
bools: Option<(&'a BooleanArray, bool)>,
}Expand description
One attribute term with everything that does not depend on the row resolved once: the four value columns downcast, the query scalar canonicalized, and — for the string column — the predicate already evaluated against the dictionary.
This used to be attr_matches, which did all of it per row: two
downcast_refs, a String allocation for canon, and a parse::<f64>()
on every ordered comparison. That measured 30.9 ns per root row against 6.1
for the allocation-free integer arm, which made an attribute filter fifteen
times dearer than a column one on the same block.
Fields§
§op: Op§strs: Option<(&'a [u32], Vec<bool>)>The str column’s dictionary codes, and which dictionary entries
satisfy the predicate.
The same trick as field_filter’s Dictionary arm: attribute values
are where telemetry repeats (see crate::schema::ATTRS), so a few
hundred string comparisons replace one per row and the row loop never
touches string data.
ponytail: evaluated over the whole dictionary, which every key in the table shares — so filtering on a rare key in a block whose values are nearly all distinct pays one comparison per distinct value to reject a handful of rows. The ceiling is a value column with no repetition in it, which is the case its dictionary encoding is already the wrong layout for; the upgrade path is a lazily filled memo over the same array.
ints: Option<(&'a [i64], i64)>§doubles: Option<(&'a [f64], f64)>§bools: Option<(&'a BooleanArray, bool)>Implementations§
Source§impl AttrPred<'_>
impl AttrPred<'_>
fn new<'a>(a: &'a RecordBatch, op: Op, v: &Value) -> AttrPred<'a>
Sourcefn test(&self, ty: u8, row: usize) -> bool
fn test(&self, ty: u8, row: usize) -> bool
Compare one attribute row against the query scalar, dispatching on the
stored type rather than on the query’s — the column decides what it
is.
Empty, Bytes, Slice and Map are returned in results but not filterable in V0, and a column whose type does not match the schema reads the same way: no match.
Auto Trait Implementations§
impl<'a> Freeze for AttrPred<'a>
impl<'a> RefUnwindSafe for AttrPred<'a>
impl<'a> Send for AttrPred<'a>
impl<'a> Sync for AttrPred<'a>
impl<'a> Unpin for AttrPred<'a>
impl<'a> UnsafeUnpin for AttrPred<'a>
impl<'a> UnwindSafe for AttrPred<'a>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].