pub trait Optimize<From> {
type To;
// Required method
fn optimize(&mut self, plan: From) -> Result<Self::To, OptimizerError>;
// Provided method
fn catch_unwind_optimize(
&mut self,
plan: From,
) -> Result<Self::To, OptimizerError> { ... }
}Expand description
A trait that represents an optimization stage.
The trait is implemented by structs that encapsulate the context needed to
run an end-to-end optimization pipeline for a specific statement type
(Index, View, MaterializedView, Subscribe, Select).
Each implementation represents a concrete optimization stage for a fixed
statement type that consumes an input of type From and produces output of
type Self::To.
Required Associated Types§
Required Methods§
Sourcefn optimize(&mut self, plan: From) -> Result<Self::To, OptimizerError>
fn optimize(&mut self, plan: From) -> Result<Self::To, OptimizerError>
Execute the optimization stage, transforming the input plan of type
From to an output plan of type To.
Provided Methods§
Sourcefn catch_unwind_optimize(
&mut self,
plan: From,
) -> Result<Self::To, OptimizerError>
fn catch_unwind_optimize( &mut self, plan: From, ) -> Result<Self::To, OptimizerError>
Like Self::optimize, but additionally ensures that panics occurring
in the Self::optimize call are caught and demoted to an
OptimizerError::Internal error.
Additionally, if the result of the optimization is an error (not a panic) that indicates we should panic, then panic.
Implementors§
Source§impl Optimize<SubscribeFrom> for mz_adapter::optimize::subscribe::Optimizer
impl Optimize<SubscribeFrom> for mz_adapter::optimize::subscribe::Optimizer
type To = GlobalMirPlan<Unresolved>
Source§impl Optimize<HirRelationExpr> for mz_adapter::optimize::copy_to::Optimizer
impl Optimize<HirRelationExpr> for mz_adapter::optimize::copy_to::Optimizer
type To = LocalMirPlan
Source§impl Optimize<HirRelationExpr> for mz_adapter::optimize::materialized_view::Optimizer
impl Optimize<HirRelationExpr> for mz_adapter::optimize::materialized_view::Optimizer
type To = LocalMirPlan
Source§impl Optimize<HirRelationExpr> for mz_adapter::optimize::peek::Optimizer
impl Optimize<HirRelationExpr> for mz_adapter::optimize::peek::Optimizer
type To = LocalMirPlan
Source§impl Optimize<HirRelationExpr> for mz_adapter::optimize::view::Optimizer<'_>
impl Optimize<HirRelationExpr> for mz_adapter::optimize::view::Optimizer<'_>
Source§impl Optimize<OptimizedMirRelationExpr> for mz_adapter::optimize::materialized_view::Optimizer
This is needed only because the pipeline in the bootstrap code starts from an
OptimizedMirRelationExpr attached to a mz_catalog::memory::objects::CatalogItem.
impl Optimize<OptimizedMirRelationExpr> for mz_adapter::optimize::materialized_view::Optimizer
This is needed only because the pipeline in the bootstrap code starts from an
OptimizedMirRelationExpr attached to a mz_catalog::memory::objects::CatalogItem.