pub enum ProjectionPushdown {
FetchAll,
IgnoreAllNonErr {
err_col_name: &'static str,
key_bytes: Vec<u8>,
val_bytes: Vec<u8>,
},
}
Expand description
Information about which columns of persist-stored data may not be needed.
TODO: This is mostly a placeholder for real projection pushdown, but in the
short-term it allows us a special case of projection pushdown: ignoring all
non-Err
data. See ProjectionPushdown::try_optimize_ignored_data_fetch.
Variants§
FetchAll
Fetch all columns.
IgnoreAllNonErr
For data with a top-level error column in the structured representation,
ignore all columns except for data in parts that may contain an error.
This may seem like a peculiar set of requirements, but it enables the
aggressive Self::try_optimize_ignored_data_fetch optimization and it
corresponds to a common query shape: SELECT count(*)
.
This error bit is certainly a bit of an abstraction breakage in the “persist is independent of mz” story, but it should go away when we implement full projection pushdown.
Implementations§
source§impl ProjectionPushdown
impl ProjectionPushdown
sourcepub(crate) fn try_optimize_ignored_data_fetch<T: Timestamp + Codec64>(
&self,
cfg: &ConfigSet,
metrics: &Metrics,
as_of: &Antichain<T>,
desc: &Description<T>,
part: &BatchPart<T>,
) -> Option<BatchPart<T>>
pub(crate) fn try_optimize_ignored_data_fetch<T: Timestamp + Codec64>( &self, cfg: &ConfigSet, metrics: &Metrics, as_of: &Antichain<T>, desc: &Description<T>, part: &BatchPart<T>, ) -> Option<BatchPart<T>>
If relevant, applies the Self::IgnoreAllNonErr projection to a part about to be fetched.
If a part contains data from entirely before a snapshot as_of
, and the
pushed-down MFP projects to an empty list of columns, and we can prove
that the part is error free, then we can use the diff sum from stats
instead of loading the data. In this case, we return a Some
with a
replacement BatchPart. In all other cases, a None.
- Summing the diffs in a part is equivalent to projecting the row in
each tuple to an empty row and then consolidating. (Which is pretty
much how
select count(*)
queries get compiled today.) - If the as-of timestamp falls in the middle of a part, we can just fetch and process the part as normal. The optimization can still provide a speedup for other parts. TODO: We could improve this by keeping track in metadata of the largest timestamp(s) in a hollow part.
Trait Implementations§
source§impl Clone for ProjectionPushdown
impl Clone for ProjectionPushdown
source§fn clone(&self) -> ProjectionPushdown
fn clone(&self) -> ProjectionPushdown
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ProjectionPushdown
impl Debug for ProjectionPushdown
Auto Trait Implementations§
impl Freeze for ProjectionPushdown
impl RefUnwindSafe for ProjectionPushdown
impl Send for ProjectionPushdown
impl Sync for ProjectionPushdown
impl Unpin for ProjectionPushdown
impl UnwindSafe for ProjectionPushdown
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> ProgressEventTimestamp for T
impl<T> ProgressEventTimestamp for T
source§impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
source§fn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
RustType::from_proto
.source§fn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
RustType::into_proto
.source§impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
source§fn plus_equals(&mut self, rhs: &&'a S)
fn plus_equals(&mut self, rhs: &&'a S)
std::ops::AddAssign
, for types that do not implement AddAssign
.