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
impl IndexSelection
Sourcepub fn with_context(context: ExecutionContext) -> Self
pub fn with_context(context: ExecutionContext) -> Self
Creates a new index selection pass with execution context.
Source§impl IndexSelection
impl IndexSelection
Sourcepub fn extract_predicates(&self, predicate: &Expr) -> Vec<PredicateInfo>
pub fn extract_predicates(&self, predicate: &Expr) -> Vec<PredicateInfo>
Extracts all simple predicates from a compound predicate.
Trait Implementations§
Source§impl Default for IndexSelection
impl Default for IndexSelection
Source§impl OptimizerPass for IndexSelection
impl OptimizerPass for IndexSelection
Source§fn optimize(&self, plan: LogicalPlan) -> LogicalPlan
fn optimize(&self, plan: LogicalPlan) -> LogicalPlan
Optimizes the given logical plan.
Auto Trait Implementations§
impl Freeze for IndexSelection
impl RefUnwindSafe for IndexSelection
impl Send for IndexSelection
impl Sync for IndexSelection
impl Unpin for IndexSelection
impl UnwindSafe for IndexSelection
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