Influxdb has the nice feature to roll up time serie data into larger time buckets via continous queries. This can tremendously speed up a query that needs to display two years of data that was originally sampled at 1Hz.
Grafana will however creates a select query on the original time serie and request a dynamic groupby time based on how far it is zoomed out. Influx will thus crunch all data points in that two year interval. There is no way in Grafana to specify to switch to the time rolled up continous query based on the groupby interval. This could potentially fixed in Grafana, however...
Grafana points out that Graphite automatically rollup its measurements as part of there measurement definition. An queries will thus automatically pick the best internally precalculated time roll up table to execute the query. Graphite therefore always answers within about 100ms. My experience with Influx is that it can take 30sec easily to return the result of a very zoomed out time serie. See https://github.com/grafana/grafana/issues/420 for more details.
This is basically a very nasty interface problem between Grafana and Influxdb and I see no urgency on either side to solve it while it is the number one performance bottleneck in this popular stack as far as I'm concerned.
The question:
Can the influx query engine use the knowledge its continous queries definitions to optimise the query engine path to use the pre calculated continous query data when a time groupby is requested on the original serie?
Highly related to https://github.com/influxdb/influxdb/issues/2625. Not quite a duplicate, but likely a fix for one addresses the other.
Tangentially related to https://github.com/influxdb/influxdb/issues/1994 as well.
I also think this should be fixed in InfluxDB. Maybe we could use a dedicated tag which defines the function (mean, count, sum, ...) to use for aggregation? E.g.:
cpu,host=server01,region=uswest,aggregate=mean value=1 1434055562000000000
This would lead to better performance on all queries with include a GROUP BY statement, but increases the database size. It could be difficult to figure out what's the optimal size/interval for these precomputed roll ups. I don't know what's Graphite is doing here.
+1. In my view, Grafana could address this by making a conditional query based on the time span. Here are a couple marked up screen shots:


So, you would create additional queries for each case where you would like to use a down sampled time series. In either case, each additional query would reference the proper continuous query for the given time span.
Here is an example of what I mean:

Largely addressed by https://github.com/influxdata/influxdb/issues/6910
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Still relevant imho as intelligent rollups didn't land
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Still relevant as can be seen in #7198
Yes, I also would like to see a solution in Grafana because I do not think InfuxDB will add that feature soon :-(
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I see that still relevant
I like this simple proposal of having conditional query in Grafana but is it the right place to request this?
Most helpful comment
Here is an example of what I mean: