Skip to content
This repository has been archived by the owner on Apr 12, 2019. It is now read-only.

time grouping applies to large limit, doesn't use the database functions for "normal" grouping intervals #42

Open
jodok opened this issue Apr 1, 2017 · 1 comment

Comments

@jodok
Copy link
Contributor

jodok commented Apr 1, 2017

if i select data for the last half year the datasource generate this query:

"SELECT floor(timestamp/86400000)*86400000 as time, count(*) FROM \"dashboard\".\"udc\" WHERE timestamp >= ? AND timestamp <= ? GROUP BY time ORDER BY time ASC LIMIT 5180400000"

it should use:

"SELECT date_trunc('day') as time, count(*) FROM \"dashboard\".\"udc\" WHERE timestamp >= ? AND timestamp <= ? GROUP BY time ORDER BY time ASC LIMIT 182"

(or more than 182 - but half a year has only 182 days).

@alexanderzobnin
Copy link
Contributor

@jodok you should use Auto interval, not Auto (grafana).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants