Hi all,
i have the same query doing a simple aggregation of values per month.
I did the same query in flux and in influxdb (influxql has the issue that i monthly aggregations are not always on the 1st but the date shifts - this is another topic anot for here - thats why i did it on flux).
The 2 queries run on the same grafana instance against the same influxdb, so the infrastructure shold not play any role.
The problem:
- runtime of influx db: fast and ok
- flux: 30s
The influxql:
SELECT difference(max(“kwH”)) FROM “autogen”.“Stromzaehler_Total” WHERE (“location”::tag = ‘wp_total_in’) AND $timeFilter GROUP BY time($__interval) fill(none)
$__interval is set in query_options to 730h (as month diesnt exist as unit???)
The flux: from(bucket: “isg/autogen”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == “Stromzaehler_Total” and r.location == “wp_total_in”)
|> aggregateWindow (every: 1mo, fn: max)
|> difference()
Any advise would be nice.
Jürgen