Top N query
How about Top N query for time-series? does influxdb support it?
What do you mean by Top N ? Did you mean last/first N in a given time range.
Maybe you mean something that could be done like this?
select count(state) from events group by state where time > yesterday
So you'd then get points with the counts for the last day. Then you can sort those values and do another query where you filter based on the ones you want to see like this:
select count(state) from events group by time(1d), state where time > last_week and state in ('NY', 'CO')
So you'd end up getting the two 2 in that case, assuming they were CO and NY.
What I mean is more like this.
select * from events order by timestamp desc limit n;
There is no order by and there are no plans to add it in the future. Everything is indexed by time series, column, and time. However, limit is supported. That query can be issued like this:
select * from events limit n;
Understood, How about this? InfluxDB may support order_by_timestamp asc / desc. NOT for all columns.
It supports order by timestamp. Can also do:
select * from events order asc limit 1
On Wed, Jan 29, 2014 at 9:16 AM, piaoyuankui [email protected]:
Understood, How about this? InfluxDB may support order_by_timestamp asc / desc. NOT for all columns.
Reply to this email directly or view it on GitHubhttps://github.com/influxdb/influxdb/issues/203#issuecomment-33587540 .
Awesome!
I don't think there's anything actionable here. So I'll go ahead and close this issue.