pub struct MLQueryOptimizer { /* private fields */ }Expand description
ML-enhanced query optimizer
Implementations§
Source§impl MLQueryOptimizer
impl MLQueryOptimizer
Sourcepub fn new(
config: MLOptimizerConfig,
performance_tracker: Arc<PerformanceTracker>,
) -> Self
pub fn new( config: MLOptimizerConfig, performance_tracker: Arc<PerformanceTracker>, ) -> Self
Create a new ML-enhanced query optimizer
Sourcepub fn extract_features(&self, document: &Document) -> Result<QueryFeatures>
pub fn extract_features(&self, document: &Document) -> Result<QueryFeatures>
Extract features from a GraphQL document
Sourcepub async fn predict_performance(
&self,
document: &Document,
) -> Result<PerformancePrediction>
pub async fn predict_performance( &self, document: &Document, ) -> Result<PerformancePrediction>
Predict query performance using ML models
Sourcepub async fn recommend_optimizations(
&self,
document: &Document,
) -> Result<Vec<OptimizationRecommendation>>
pub async fn recommend_optimizations( &self, document: &Document, ) -> Result<Vec<OptimizationRecommendation>>
Generate optimization recommendations based on ML predictions
Sourcepub async fn record_execution(
&self,
document: &Document,
metrics: &OperationMetrics,
) -> Result<()>
pub async fn record_execution( &self, document: &Document, metrics: &OperationMetrics, ) -> Result<()>
Record query execution for learning
Sourcepub async fn add_training_sample(&self, sample: TrainingSample) -> Result<()>
pub async fn add_training_sample(&self, sample: TrainingSample) -> Result<()>
Add a pre-built training sample directly (used by external callers who don’t have a Document)
Sourcepub async fn update_models(&self) -> Result<()>
pub async fn update_models(&self) -> Result<()>
Update ML models with new training data
Auto Trait Implementations§
impl !RefUnwindSafe for MLQueryOptimizer
impl !UnwindSafe for MLQueryOptimizer
impl Freeze for MLQueryOptimizer
impl Send for MLQueryOptimizer
impl Sync for MLQueryOptimizer
impl Unpin for MLQueryOptimizer
impl UnsafeUnpin for MLQueryOptimizer
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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