Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow querying only for time #4862

Closed
nornagon opened this issue Nov 21, 2015 · 3 comments
Closed

Allow querying only for time #4862

nornagon opened this issue Nov 21, 2015 · 3 comments

Comments

@nornagon
Copy link

I'd like to write a query that only returns the time of the last value for a given series. e.g.

SELECT time
FROM temperature
WHERE time > now() - 1d
GROUP BY deviceId
ORDER BY time DESC
LIMIT 1

Barring the fact that ORDER BY time DESC doesn't work (#4861), InfluxDB also refuses to execute a query that only returns time (not, say, value).

My use case for this is building an alerting system that will tell you if a sensor stops reporting data. The above query should return the timestamp of the latest data point for any sensor that has reported data in the last day, grouped by sensor ID.

It's possible to get around this limitation by querying the data directly (SELECT value), but it doesn't seem like it ought to be necessary.

@samhatchett
Copy link

+1

and not just for the LIMIT 1 case - my application sometimes needs to know times but not values for a series, and this would I assume cut down the communication overhead a bit

@dgnorton dgnorton added the 1.x label Jan 7, 2019
@stale
Copy link

stale bot commented Jul 23, 2019

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.

@stale stale bot added the wontfix label Jul 23, 2019
@stale
Copy link

stale bot commented Jul 30, 2019

This issue has been automatically closed because it has not had recent activity. Please reopen if this issue is still important to you. Thank you for your contributions.

@stale stale bot closed this as completed Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants