influxdata / influxdata/influxdb
Add '--show-stats' to 'influxdb3 query'
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
It would be nice to have the option to return some query execution statistics when using the `influxdb3 query` command. This would be set to `false` by default, but when enabled, it would output query statistics to stdout. For example:
```sh
> influxdb3 query --database my-db --show-stats 'select * from table'
#...
Query statistics
----------------
plan_duration: ...
permit_duration: ...
execute_duration: ...
end2end_duration: ...
compute_duration: ...
max_memory: ...
```
__Use case:__
This would help to easily see execution stats of single queries and provide an alternative to having to query stats from system tables.
__Alternatives considered:__
DataFusion outputs query durations in their REPL, so I believe at least some of this data is available at query time. AFAIK, this functionality isn't exposed in a usable way.
Contributor guide
Research direction
Start at the `influxdb3 query` command entry point and inspect how DataFusion exposes query execution statistics, including the durations and memory values listed in the issue. Confirm how system-table statistics and DataFusion's REPL output obtain this data. Done means a false-by-default `--show-stats` option prints query results followed by the requested statistics when enabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, sql
- Domain
- cli, databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100