pub struct QueryStats {
pub query_hash: u64,
pub actual_rows: usize,
pub estimated_rows: usize,
pub execution_time_ms: u64,
pub join_order: Vec<String>,
pub selectivity_by_pattern: HashMap<String, f64>,
}Expand description
Statistics recorded for a single query execution.
Fields§
§query_hash: u64Hash of the query string (see AdaptiveQueryOptimizer::hash_query).
actual_rows: usizeNumber of rows actually produced.
estimated_rows: usizeNumber of rows the optimizer estimated would be produced.
execution_time_ms: u64Wall-clock time consumed by the execution, in milliseconds.
join_order: Vec<String>The join order that was used, as a list of pattern descriptions.
selectivity_by_pattern: HashMap<String, f64>Per-pattern selectivities observed during execution.
Implementations§
Source§impl QueryStats
impl QueryStats
Sourcepub fn new(
query_hash: u64,
actual_rows: usize,
estimated_rows: usize,
execution_time_ms: u64,
join_order: Vec<String>,
selectivity_by_pattern: HashMap<String, f64>,
) -> Self
pub fn new( query_hash: u64, actual_rows: usize, estimated_rows: usize, execution_time_ms: u64, join_order: Vec<String>, selectivity_by_pattern: HashMap<String, f64>, ) -> Self
Construct a new QueryStats value.
Sourcepub fn accuracy_ratio(&self) -> f64
pub fn accuracy_ratio(&self) -> f64
Ratio of actual to estimated rows. Returns 1.0 when no estimate exists.
Trait Implementations§
Source§impl Clone for QueryStats
impl Clone for QueryStats
Source§fn clone(&self) -> QueryStats
fn clone(&self) -> QueryStats
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 QueryStats
impl RefUnwindSafe for QueryStats
impl Send for QueryStats
impl Sync for QueryStats
impl Unpin for QueryStats
impl UnsafeUnpin for QueryStats
impl UnwindSafe for QueryStats
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