pub struct Decorrelator { /* private fields */ }Expand description
Subquery decorrelation optimizer
Implementations§
Source§impl Decorrelator
impl Decorrelator
Sourcepub fn new() -> Decorrelator
pub fn new() -> Decorrelator
Create a new decorrelator
Sourcepub fn analyze(
&self,
outer_refs: &[String],
inner_cols: &[String],
correlation_predicates: &[(String, String)],
subquery_type: SubqueryKind,
has_aggregation: bool,
has_limit: bool,
) -> SubqueryAnalysis
pub fn analyze( &self, outer_refs: &[String], inner_cols: &[String], correlation_predicates: &[(String, String)], subquery_type: SubqueryKind, has_aggregation: bool, has_limit: bool, ) -> SubqueryAnalysis
Analyze a correlated subquery for decorrelation potential
Sourcepub fn estimate_speedup(
&self,
outer_cardinality: usize,
inner_cardinality: usize,
strategy: &DecorrelationStrategy,
) -> f64
pub fn estimate_speedup( &self, outer_cardinality: usize, inner_cardinality: usize, strategy: &DecorrelationStrategy, ) -> f64
Estimate cost improvement from decorrelation Returns the ratio of (correlated cost) / (decorrelated cost)
Sourcepub fn should_decorrelate(
&self,
outer_cardinality: usize,
inner_cardinality: usize,
strategy: &DecorrelationStrategy,
) -> bool
pub fn should_decorrelate( &self, outer_cardinality: usize, inner_cardinality: usize, strategy: &DecorrelationStrategy, ) -> bool
Check if decorrelation is worthwhile based on cardinality
Source§impl Decorrelator
impl Decorrelator
Sourcepub fn plan_rewrite(
&mut self,
analysis: &SubqueryAnalysis,
aggregation_col: Option<&str>,
) -> Option<SubqueryRewrite>
pub fn plan_rewrite( &mut self, analysis: &SubqueryAnalysis, aggregation_col: Option<&str>, ) -> Option<SubqueryRewrite>
Generate a rewrite plan for a decorrelatable subquery
Trait Implementations§
Source§impl Default for Decorrelator
impl Default for Decorrelator
Source§fn default() -> Decorrelator
fn default() -> Decorrelator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Decorrelator
impl RefUnwindSafe for Decorrelator
impl Send for Decorrelator
impl Sync for Decorrelator
impl Unpin for Decorrelator
impl UnsafeUnpin for Decorrelator
impl UnwindSafe for Decorrelator
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 moreSource§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>
Wrap the input message
T in a tonic::Request