pub struct QueryProgress {
pub percentage: f64,
pub rows_processed: u64,
pub total_rows_to_process: u64,
}Expand description
A snapshot of a running query’s progress.
percentage is -1.0 when DuckDB cannot report progress — the progress
bar is disabled (SET enable_progress_bar = true turns it on), no query is
running, or the connection handle was null.
On DuckDB 1.x it is also -1.0 for as long as any pipeline of the
running query cannot estimate its progress: ProgressBar::Update
(progress_bar.cpp, 1.5.6) leaves the percentage untouched while one
reports none, and the value is refreshed only between the executor tasks
the querying thread runs (ClientContext::ExecuteTaskInternal).
A -1.0 was read throughout a query on 1.5.6 where 2.0.0 reported
1.18 %, 1.34 %, 1.47 % for the same one (observed in a review, not
re-run for this documentation). Treat -1.0 as “unknown”, not as an error.
The three fields are read from separate atomics, so they are individually current but not a consistent snapshot of one instant.
Fields§
§percentage: f64Percent complete in 0.0..=100.0, or -1.0 when unavailable.
rows_processed: u64Rows processed so far.
total_rows_to_process: u64Rows the plan expects to process in total.
Trait Implementations§
Source§impl Clone for QueryProgress
impl Clone for QueryProgress
Source§fn clone(&self) -> QueryProgress
fn clone(&self) -> QueryProgress
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more