influxdata / influxdata/influxdb
flux querying the _time group is slow
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
InfluxDB v2.7.8
I perform a flux query and group and sum by time_time. The query is very slow, taking about 3 seconds to process 50000 pieces of data. However, grouping by fields in other tags is very fast, taking less than a second. Why is this? Is there anything that needs to be set
`
from(bucket: "bucket1")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "node_cpu_seconds_total") //prometheus metrics
|> group (columns: ["_time"])
// |> group (columns: ["ip_address"])
|> sum()
`
thanks
Contributor guide
Research direction
Start by reproducing the Flux query against InfluxDB v2.7.8 with the reported 50,000 data points. Compare grouping by _time with grouping by ip_address, then inspect the query execution behavior to determine why the _time grouping is slower. Done means the cause is identified and a documented fix or actionable configuration is provided.
Written by the indexing model from the issue text.
Assessment
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100