Skip to main content

QueryOptimizer

Struct QueryOptimizer 

Source
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: OptimizerConfig

Implementations§

Source§

impl QueryOptimizer

Source

pub fn new() -> Self

Source

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.

Source

pub fn with_graph_stats(self, gs: GraphStats) -> Self

Source

pub fn with_graph_store(self, store: Arc<dyn GraphStoreSampler>) -> Self

Source

pub fn with_row_count(self, n: u64) -> Self

Source

pub fn with_index_stats(self, stats: IndexStats) -> Self

Source

pub fn with_column_stats(self, stats: BTreeMap<String, ColumnStats>) -> Self

Source

pub fn optimize(&self, op: OperatorTree) -> OperatorTree

Optimize a query through the complete rewrite pipeline.

Trait Implementations§

Source§

impl Default for QueryOptimizer

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.