Update direct-db-connection.md

I see what you're saying. Is this better? I reworded slightly and swapped a few others around.

If this isn't better, I'm happy to change again.
This commit is contained in:
Trent White
2017-07-27 12:07:57 -04:00
committed by GitHub
parent 4c39fec007
commit 1f0eb082aa

View File

@@ -52,9 +52,8 @@ panel with in pixels. Thus, Grafana always gets data in necessary resolution.
## Functions usage with Direct DB Connection
There's only one function affecting backend. This function is `consolidateBy`. It changes what data comes from
the backend. Other functions still work on the client side and transform data come from the backend. So you should
clearly understand that you work with pre-aggregated data (by AVG, MAX, MIN, etc). For example, you want to group
values by 1 hour interval and `max` function. But if you just apply `groupBy(10m, max)` function, result will be wrong,
because you transform data aggregated by default `AVG` function. You should use `consolidateBy(max)` coupled with
`groupBy(10m, max)` in order to get precise result.
There's only one function affecting the backend. This function is `consolidateBy`. It changes what data comes from
the backend. Other functions still work on the client side and transform data that comes from the backend. So you should
clearly understand that this is pre-aggregated data (by AVG, MAX, MIN, etc).
For example, say you want to group values by 1 hour interval and `max` function. If you just apply `groupBy(10m, max)` function, your result will be wrong, because you would transform data aggregated by default `AVG` function. You should use `consolidateBy(max)` coupled with `groupBy(10m, max)` in order to get a precise result.