pub enum QueryPlan {
Scan {
measurement: String,
tag_filters: Vec<TagFilter>,
projection: Vec<String>,
time_range: TimeRange,
field_predicates: Vec<FieldPredicate>,
namespace_id: Option<String>,
},
Aggregate {
source: Box<QueryPlan>,
functions: Vec<AggFn>,
group_by: Vec<String>,
estimated_cardinality: Option<usize>,
},
Downsample {
source: Box<QueryPlan>,
interval: Duration,
function: AggFn,
},
Limit {
source: Box<QueryPlan>,
limit: usize,
offset: usize,
},
Window {
source: Box<QueryPlan>,
functions: Vec<WindowFn>,
partition_by: Vec<String>,
value_column: String,
},
}Expand description
A logical query plan.
Describes what data to read and how to process it, without specifying the physical execution strategy.
Variants§
Scan
Scan a measurement with optional filters and projection.
Fields
field_predicates: Vec<FieldPredicate>Zone-map field predicates for late-materialisation row-group pruning. Each predicate compares a numeric column against a threshold; row groups whose per-block min/max stats rule out any match are skipped entirely.
Aggregate
Aggregate results from a scan.
Fields
Downsample
Downsample results into time buckets.
Fixed-width buckets only. A Duration is a span of nanoseconds,
so this cannot express a calendar bucket — a day in a time zone is 23
or 25 hours across a transition, and a month is not a span at all. The
type says so rather than pretending: the two surfaces that do offer
calendar buckets are time_bucket() in SQL and a rollup tier, and both
go through chronix::timebucket::TimeBucket. Threading that through
here would put the tz database inside the query engine for a surface
nobody has asked it of.
Fields
Limit
Limit the number of returned rows, optionally skipping some.
Fields
Window
Apply window functions that produce one output row per input row.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for QueryPlan
impl RefUnwindSafe for QueryPlan
impl Send for QueryPlan
impl Sync for QueryPlan
impl Unpin for QueryPlan
impl UnsafeUnpin for QueryPlan
impl UnwindSafe for QueryPlan
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,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more