pub struct QueryOptimizer {
pub estimator: CardinalityEstimator,
pub cost_model: CostModel,
pub graph_stats: Option<GraphStats>,
pub index_candidates: Vec<IndexScanCandidate>,
pub table_name: Option<String>,
pub row_count: Option<u64>,
pub index_stats: IndexStats,
pub config: OptimizerConfig,
}Expand description
Operator-tree query optimizer.
Fields§
§estimator: CardinalityEstimator§cost_model: CostModel§graph_stats: Option<GraphStats>§index_candidates: Vec<IndexScanCandidate>§table_name: Option<String>§row_count: Option<u64>§index_stats: IndexStats§config: OptimizerConfigImplementations§
Source§impl QueryOptimizer
impl QueryOptimizer
pub fn new() -> Self
Sourcepub fn with_index_candidates(
self,
candidates: impl IntoIterator<Item = IndexScanCandidate>,
table: impl Into<String>,
) -> Self
pub fn with_index_candidates( self, candidates: impl IntoIterator<Item = IndexScanCandidate>, table: impl Into<String>, ) -> Self
Attach immutable scan candidates discovered from the caller’s catalog snapshot. The optimizer selects among these candidates without retaining a storage handle.
pub fn with_graph_stats(self, gs: GraphStats) -> Self
pub fn with_graph_store(self, store: Arc<dyn GraphStoreSampler>) -> Self
pub fn with_row_count(self, n: u64) -> Self
pub fn with_index_stats(self, stats: IndexStats) -> Self
pub fn with_column_stats(self, stats: BTreeMap<String, ColumnStats>) -> Self
Sourcepub fn optimize(&self, op: OperatorTree) -> OperatorTree
pub fn optimize(&self, op: OperatorTree) -> OperatorTree
Optimize a query through the complete rewrite pipeline.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for QueryOptimizer
impl !UnwindSafe for QueryOptimizer
impl Freeze for QueryOptimizer
impl Send for QueryOptimizer
impl Sync for QueryOptimizer
impl Unpin for QueryOptimizer
impl UnsafeUnpin for QueryOptimizer
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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 more