pub struct QueryPlanner { /* private fields */ }Expand description
Query planner that converts Query into optimized PhysicalPlan
The planner applies predicate pushdown, filter merging, and cost-based selection to produce an execution plan that minimises expensive FHE operations and I/O.
Optionally maintains a plan cache to avoid re-planning identical queries.
Implementations§
Source§impl QueryPlanner
impl QueryPlanner
Sourcepub fn with_stats(stats: Arc<PlannerStats>) -> Self
pub fn with_stats(stats: Arc<PlannerStats>) -> Self
Create a planner with custom statistics
Sourcepub fn with_cache(self, config: PlanCacheConfig) -> Self
pub fn with_cache(self, config: PlanCacheConfig) -> Self
Enable plan caching with the given configuration
Sourcepub fn stats(&self) -> &PlannerStats
pub fn stats(&self) -> &PlannerStats
Get a reference to the planner statistics
Sourcepub fn plan_cache(&self) -> Option<&PlanCache>
pub fn plan_cache(&self) -> Option<&PlanCache>
Get a reference to the plan cache, if enabled
Sourcepub fn cache_stats(&self) -> CacheStats
pub fn cache_stats(&self) -> CacheStats
Return cache statistics, or default stats if caching is not enabled
Sourcepub fn invalidate_all(&self)
pub fn invalidate_all(&self)
Invalidate all cached plans (e.g., after a schema change)
Sourcepub fn invalidate_prefix(&self, prefix: &str)
pub fn invalidate_prefix(&self, prefix: &str)
Invalidate cached plans matching a prefix (e.g., a collection name)
Sourcepub fn plan(&self, query: &Query) -> Result<PhysicalPlan>
pub fn plan(&self, query: &Query) -> Result<PhysicalPlan>
Plan a query
If caching is enabled, checks the cache first and returns a cached plan if one exists and has not expired. Otherwise, plans the query from scratch and inserts the result into the cache.
Sourcepub fn estimate_cost(&self, plan: &PhysicalPlan) -> PlanCost
pub fn estimate_cost(&self, plan: &PhysicalPlan) -> PlanCost
Estimate the cost of a physical plan
Sourcepub fn choose_cheaper<'a>(
&self,
a: &'a PhysicalPlan,
b: &'a PhysicalPlan,
) -> &'a PhysicalPlan
pub fn choose_cheaper<'a>( &self, a: &'a PhysicalPlan, b: &'a PhysicalPlan, ) -> &'a PhysicalPlan
Compare two physical plans by cost and return the cheaper one
Trait Implementations§
Auto Trait Implementations§
impl Freeze for QueryPlanner
impl !RefUnwindSafe for QueryPlanner
impl Send for QueryPlanner
impl Sync for QueryPlanner
impl Unpin for QueryPlanner
impl UnsafeUnpin for QueryPlanner
impl !UnwindSafe for QueryPlanner
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
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>
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>
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.