pub struct QueryAnalysis {
pub original_query: String,
pub tables: Vec<TableRef>,
pub access_patterns: Vec<AccessPattern>,
pub shard_keys: HashMap<String, ShardKeyValue>,
pub workload_type: WorkloadType,
pub complexity: u32,
pub selectivity: f64,
pub is_read_only: bool,
pub has_aggregations: bool,
pub has_joins: bool,
pub has_subqueries: bool,
}Expand description
Query analysis result
Fields§
§original_query: StringOriginal query
tables: Vec<TableRef>Tables referenced
access_patterns: Vec<AccessPattern>Access patterns per table
shard_keys: HashMap<String, ShardKeyValue>Extracted shard keys
workload_type: WorkloadTypeClassified workload type
complexity: u32Estimated complexity (0-100)
selectivity: f64Estimated selectivity (0.0 - 1.0)
is_read_only: boolIs read-only query
has_aggregations: boolHas aggregation functions
has_joins: boolHas JOIN clauses
has_subqueries: boolHas subqueries
Implementations§
Source§impl QueryAnalysis
impl QueryAnalysis
Sourcepub fn is_vector_query(&self) -> bool
pub fn is_vector_query(&self) -> bool
Check if query involves vector operations
Sourcepub fn is_analytics(&self) -> bool
pub fn is_analytics(&self) -> bool
Check if query is analytics (OLAP)
Sourcepub fn primary_table(&self) -> Option<&TableRef>
pub fn primary_table(&self) -> Option<&TableRef>
Get primary table (first table in query)
Sourcepub fn has_shard_key(&self) -> bool
pub fn has_shard_key(&self) -> bool
Check if query targets a specific shard
Trait Implementations§
Source§impl Clone for QueryAnalysis
impl Clone for QueryAnalysis
Source§fn clone(&self) -> QueryAnalysis
fn clone(&self) -> QueryAnalysis
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for QueryAnalysis
impl RefUnwindSafe for QueryAnalysis
impl Send for QueryAnalysis
impl Sync for QueryAnalysis
impl Unpin for QueryAnalysis
impl UnsafeUnpin for QueryAnalysis
impl UnwindSafe for QueryAnalysis
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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