pub struct QueryStats {Show 13 fields
pub elapsed_s: f64,
pub commit_time_s: Option<f64>,
pub time_to_schedule_s: Option<f64>,
pub pre_execution: Option<PreExecutionStats>,
pub execution: Option<ExecutionStats>,
pub result_size_mb: Option<f64>,
pub peak_result_buffer_memory_mb: Option<f64>,
pub plan_cache_status: Option<String>,
pub plan_cache_hit_count: Option<u32>,
pub statement_type: Option<String>,
pub rows: Option<u64>,
pub cols: Option<u32>,
pub query_truncated: Option<String>,
}Expand description
Detailed statistics for a single query execution.
All time fields are in seconds. Memory fields are in megabytes.
Fields are Option because not all queries produce all stats (e.g., a simple
SET command won’t have execution storage stats).
Fields§
§elapsed_s: f64Total elapsed wall-clock time for the query (seconds).
commit_time_s: Option<f64>Time spent committing the transaction (seconds).
time_to_schedule_s: Option<f64>Time waiting to be scheduled on a worker thread (seconds).
pre_execution: Option<PreExecutionStats>Pre-execution phase stats (parsing, compilation).
execution: Option<ExecutionStats>Execution phase stats (runtime, CPU, storage I/O).
result_size_mb: Option<f64>Size of the result set sent to the client (MB).
peak_result_buffer_memory_mb: Option<f64>Peak memory used by the result buffer (MB).
plan_cache_status: Option<String>Plan cache status: “cache miss”, “cache hit”, “not run yet”, etc.
plan_cache_hit_count: Option<u32>Number of times the cached plan was reused.
statement_type: Option<String>Statement type: “SELECT”, “INSERT”, “SET”, “ATTACH”, “PREPARE”, etc.
rows: Option<u64>Number of result rows.
cols: Option<u32>Number of result columns.
query_truncated: Option<String>Truncated query text (as logged by Hyper).
Trait Implementations§
Source§impl Clone for QueryStats
impl Clone for QueryStats
Source§fn clone(&self) -> QueryStats
fn clone(&self) -> QueryStats
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for QueryStats
impl Debug for QueryStats
Source§impl Default for QueryStats
impl Default for QueryStats
Source§fn default() -> QueryStats
fn default() -> QueryStats
Auto 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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request