Expand description
Whole-dataflow optimization
A dataflow may contain multiple views, each of which may only be optimized locally. However, information like demand and predicate pushdown can be applied across views once we understand the context in which the views will be executed.
Structsยง
- Collect
Index ๐Requests - Dataflow
Metainfo - Extra information about the dataflow. This is not going to be shipped, but has to be processed in other ways, e.g., showing notices to the user, or saving meta-information to the catalog.
- Index
Usage ๐Context - This struct will save info about parent nodes as we are descending down a
MirRelationExpr
. We always start with filling inusage_type
when we see an operation that uses an arrangement, and then we fill inrequested_keys
when we see anArrangeBy
. So, the pattern that we are looking for is
Functionsยง
- choose_
index ๐ - Pick an index from a given Vec of index keys.
- inline_
views ๐ - Inline views used in one other view, and in no exported objects.
- optimize_
dataflow - Optimizes the implementation of each dataflow.
- optimize_
dataflow_ ๐demand - Pushes demand information from published outputs to dataflow inputs, projecting away unnecessary columns.
- optimize_
dataflow_ demand_ inner - Pushes demand through views in
view_sequence
in order, removing columns not demanded. - optimize_
dataflow_ ๐filters - Pushes predicate to dataflow inputs.
- optimize_
dataflow_ filters_ inner - Pushes filters down through views in
view_sequence
in order. - optimize_
dataflow_ monotonic - Propagates information about monotonic inputs through operators,
using
mz_repr::optimize::OptimizerFeatures
fromctx
forcrate::analysis::Analysis
. - optimize_
dataflow_ ๐relations - Performs either the logical or the physical optimization pass on the dataflow using the supplied set of indexes.
- prune_
and_ ๐annotate_ dataflow_ index_ imports - Restricts the indexes imported by
dataflow
to only the ones it needs. It also adds to theDataflowMetainfo
how each index will be used. It also annotates globalGet
s with whether they will be reads from Persist or an index, plus their index usage types.