Skip to main content

IndexSelection

Struct IndexSelection 

Source
pub struct IndexSelection { /* private fields */ }
Expand description

Index selection optimization.

Analyzes predicates and selects appropriate indexes for scans. This pass identifies Filter(Scan) patterns where the filter predicate can be satisfied using an index, converting them to IndexScan operations.

Supports:

  • Point lookups: col = value → IndexGet
  • Range scans: col > value, col < value, etc. → IndexScan
  • IN queries: col IN (v1, v2, v3) → IndexInGet
  • JSONB queries with GIN indexes → GinIndexScan

Implementations§

Source§

impl IndexSelection

Source

pub fn new() -> Self

Creates a new index selection pass without context.

Source

pub fn with_context(context: ExecutionContext) -> Self

Creates a new index selection pass with execution context.

Source§

impl IndexSelection

Source

pub fn extract_predicates(&self, predicate: &Expr) -> Vec<PredicateInfo>

Extracts all simple predicates from a compound predicate.

Trait Implementations§

Source§

impl Default for IndexSelection

Source§

fn default() -> Self

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

impl OptimizerPass for IndexSelection

Source§

fn optimize(&self, plan: LogicalPlan) -> LogicalPlan

Optimizes the given logical plan.
Source§

fn name(&self) -> &'static str

Returns the name of this pass.

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.