pub trait ExecutablePlanOptimizer {
// Required methods
fn plan_for_execution(
&self,
plan: UnifiedPlan,
params: &[SQLParam],
) -> Result<UnifiedPlan, SQLError>;
fn plan_with_result(
&self,
plan: UnifiedPlan,
params: &[SQLParam],
) -> Result<(UnifiedPlan, AnalyzedResult), SQLError>;
// Provided methods
fn plan_with_cached_analysis(
&self,
plan: UnifiedPlan,
params: &[SQLParam],
_cached: Option<Arc<AnalyzedStatement>>,
) -> Result<(UnifiedPlan, Option<Arc<AnalyzedStatement>>), SQLError> { ... }
fn plan_for_statement_cache(
&self,
plan: UnifiedPlan,
params: &[SQLParam],
) -> Result<(UnifiedPlan, bool), SQLError> { ... }
}Expand description
Analyze and optimize a logical plan using metadata captured for this call.
Required Methods§
fn plan_for_execution( &self, plan: UnifiedPlan, params: &[SQLParam], ) -> Result<UnifiedPlan, SQLError>
Sourcefn plan_with_result(
&self,
plan: UnifiedPlan,
params: &[SQLParam],
) -> Result<(UnifiedPlan, AnalyzedResult), SQLError>
fn plan_with_result( &self, plan: UnifiedPlan, params: &[SQLParam], ) -> Result<(UnifiedPlan, AnalyzedResult), SQLError>
Analyze and optimize a logical plan, and return what its analysis derives about its result.
Provided Methods§
Sourcefn plan_with_cached_analysis(
&self,
plan: UnifiedPlan,
params: &[SQLParam],
_cached: Option<Arc<AnalyzedStatement>>,
) -> Result<(UnifiedPlan, Option<Arc<AnalyzedStatement>>), SQLError>
fn plan_with_cached_analysis( &self, plan: UnifiedPlan, params: &[SQLParam], _cached: Option<Arc<AnalyzedStatement>>, ) -> Result<(UnifiedPlan, Option<Arc<AnalyzedStatement>>), SQLError>
Reuse analysis only after the caller validates its catalog/scope in the selected snapshot. Optimization still runs for this invocation. The default retains full analysis for implementations without this capability.
Sourcefn plan_for_statement_cache(
&self,
plan: UnifiedPlan,
params: &[SQLParam],
) -> Result<(UnifiedPlan, bool), SQLError>
fn plan_for_statement_cache( &self, plan: UnifiedPlan, params: &[SQLParam], ) -> Result<(UnifiedPlan, bool), SQLError>
Return an executable and whether its analysis inputs permit reuse across ordinary messages. Planners without that evidence must analyze again.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".