{"action":"created","issue":{"url":"https://api.github.com/repos/influxdb/influxdb/issues/3802","labels_url":"https://api.github.com/repos/influxdb/influxdb/issues/3802/labels{/name}","comments_url":"https://api.github.com/repos/influxdb/influxdb/issues/3802/comments","events_url":"https://api.github.com/repos/influxdb/influxdb/issues/3802/events","html_url":"https://github.com/influxdb/influxdb/issues/3802","id":102564314,"number":3802,"title":"Aggregate function 'mean' don't return all available points","user":{"login":"papylhomme","id":722015,"avatar_url":"https://avatars.githubusercontent.com/u/722015?v=3","gravatar_id":"","url":"https://api.github.com/users/papylhomme","html_url":"https://github.com/papylhomme","followers_url":"https://api.github.com/users/papylhomme/followers","following_url":"https://api.github.com/users/papylhomme/following{/other_user}","gists_url":"https://api.github.com/users/papylhomme/gists{/gist_id}","starred_url":"https://api.github.com/users/papylhomme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/papylhomme/subscriptions","organizations_url":"https://api.github.com/users/papylhomme/orgs","repos_url":"https://api.github.com/users/papylhomme/repos","events_url":"https://api.github.com/users/papylhomme/events{/privacy}","received_events_url":"https://api.github.com/users/papylhomme/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-22T20:05:28Z","updated_at":"2015-08-24T18:19:37Z","closed_at":null,"body":" I'm experiencing a strange behaviour when querying the data:\r\n\r\n- simple query _select * from users_value where host='danska' and time > now() - 2h_ returns first result at 18h00 and points every 10 seconds till 19:30:00 (request results: https://gist.github.com/papylhomme/5c4afb2004142f158587#file-res_select-json)\r\n- query _select mean(value) from users_value where host='danska' and time > now() - 2h group by time(10s)_ returns nothing for 17:XX:XX, 1 value at 18:00:00 and nothing for 18:XX:XX, and a value for each 10 seconds in 19:XX:XX (request results: https://gist.github.com/papylhomme/5c4afb2004142f158587#file-res_mean-json)\r\n- query _select derivative(value) from users_value where host='danska' and time > now() - 2h group by time(10s)_ works as expected with a point every 10 seconds. (request results: https://gist.github.com/papylhomme/5c4afb2004142f158587#file-res_derivative-json)\r\n\r\nPlease note this behaviour appeared after a fix (https://github.com/influxdb/influxdb/issues/3702) to ensure shard groups of 1 hour (see logs below). \r\n\r\n```\r\naoût 22 19:38:22 danska influxd[15923]: [retention] 2015/08/22 19:38:22 shard '69', start time '2015-08-22 16:00:00 +0000 UTC', end time '2015-08-22 17:00:00 +0000 UTC', deleted at '0001-01-01\r\naoût 22 19:38:22 danska influxd[15923]: [retention] 2015/08/22 19:38:22 shard '70', start time '2015-08-22 17:00:00 +0000 UTC', end time '2015-08-22 18:00:00 +0000 UTC', deleted at '0001-01-01\r\naoût 22 19:38:22 danska influxd[15923]: [retention] 2015/08/22 19:38:22 shard '71', start time '2015-08-22 18:00:00 +0000 UTC', end time '2015-08-22 19:00:00 +0000 UTC', deleted at '0001-01-01\r\n```"},"comment":{"url":"https://api.github.com/repos/influxdb/influxdb/issues/comments/134324583","html_url":"https://github.com/influxdb/influxdb/issues/3802#issuecomment-134324583","issue_url":"https://api.github.com/repos/influxdb/influxdb/issues/3802","id":134324583,"user":{"login":"beckettsean","id":6537329,"avatar_url":"https://avatars.githubusercontent.com/u/6537329?v=3","gravatar_id":"","url":"https://api.github.com/users/beckettsean","html_url":"https://github.com/beckettsean","followers_url":"https://api.github.com/users/beckettsean/followers","following_url":"https://api.github.com/users/beckettsean/following{/other_user}","gists_url":"https://api.github.com/users/beckettsean/gists{/gist_id}","starred_url":"https://api.github.com/users/beckettsean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beckettsean/subscriptions","organizations_url":"https://api.github.com/users/beckettsean/orgs","repos_url":"https://api.github.com/users/beckettsean/repos","events_url":"https://api.github.com/users/beckettsean/events{/privacy}","received_events_url":"https://api.github.com/users/beckettsean/received_events","type":"User","site_admin":false},"created_at":"2015-08-24T18:19:37Z","updated_at":"2015-08-24T18:19:37Z","body":"@papylhomme from the first bullet point it sounds like the timestamps are all exactly 10 seconds apart, since you get results every 10 seconds without a `GROUP BY time(10s)`. \r\n\r\nGiven that, perhaps there's a strange edge case behavior when grouping by a time interval that's exactly equal to the point spacing. Do you get meaningful results from `select mean(value) from users_value where host='danska' and time > now() - 2h group by time(14s)` \r\n\r\nAlso, what version of InfluxDB are you running?"}}