{"action":"created","issue":{"url":"https://api.github.com/repos/influxdb/influxdb/issues/4626","labels_url":"https://api.github.com/repos/influxdb/influxdb/issues/4626/labels{/name}","comments_url":"https://api.github.com/repos/influxdb/influxdb/issues/4626/comments","events_url":"https://api.github.com/repos/influxdb/influxdb/issues/4626/events","html_url":"https://github.com/influxdb/influxdb/issues/4626","id":114327786,"number":4626,"title":"Slow query performance","user":{"login":"bwhaley","id":503816,"avatar_url":"https://avatars.githubusercontent.com/u/503816?v=3","gravatar_id":"","url":"https://api.github.com/users/bwhaley","html_url":"https://github.com/bwhaley","followers_url":"https://api.github.com/users/bwhaley/followers","following_url":"https://api.github.com/users/bwhaley/following{/other_user}","gists_url":"https://api.github.com/users/bwhaley/gists{/gist_id}","starred_url":"https://api.github.com/users/bwhaley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bwhaley/subscriptions","organizations_url":"https://api.github.com/users/bwhaley/orgs","repos_url":"https://api.github.com/users/bwhaley/repos","events_url":"https://api.github.com/users/bwhaley/events{/privacy}","received_events_url":"https://api.github.com/users/bwhaley/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/influxdb/influxdb/labels/category/queries","name":"category/queries","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-10-30T18:27:54Z","updated_at":"2015-10-30T22:28:51Z","closed_at":null,"body":"As per discussion on the mailing list, I'm having trouble with a slow query. To summarize the original problem statement:\r\n\r\n```\r\n $ time influx -database graphitedb -execute \"SELECT mean(system) FROM cpu WHERE env='prod' AND time > now() - 6h GROUP BY time(10m)\"\r\nname: cpu\r\n---------\r\ntime\t\t\tmean\r\n[snip]\r\nreal\t0m6.300s\r\n```\r\n\r\n> There are 8 fields on the cpu measurement, 5 tags. and 42 matches for env='prod'.\r\n> This similar query takes < 500ms:\r\n\r\n```\r\n$ time influx -database graphitedb -execute \"SELECT mean(midterm) FROM load WHERE env='prod' AND time > now() - 6h GROUP BY time(10m)\"\r\nname: load\r\n----------\r\ntime\t\t\tmean\r\n[snip]\r\nreal\t0m0.449s\r\n```\r\n\r\n> There are only 3 fields on the load measurement and 4 tags.\r\n\r\n> Any ideas why one takes so much longer than the other? It's only a 6h window, and if I group by 1m instead of 10m the query takes a minute or more.\r\n\r\n`env` is a tag. Both `load` and `cpu` have about the same amount of data - 10s resolution and being sent from the same client, collectd. \r\n\r\n@otoolep suggested I open an issue. I am able to provide the data, let me know the best way to get that to you. Philip also suggested that we profile that query and that you could provide the instructions on how to do it. \r\n\r\nThanks!\r\n"},"comment":{"url":"https://api.github.com/repos/influxdb/influxdb/issues/comments/152665231","html_url":"https://github.com/influxdb/influxdb/issues/4626#issuecomment-152665231","issue_url":"https://api.github.com/repos/influxdb/influxdb/issues/4626","id":152665231,"user":{"login":"otoolep","id":536312,"avatar_url":"https://avatars.githubusercontent.com/u/536312?v=3","gravatar_id":"","url":"https://api.github.com/users/otoolep","html_url":"https://github.com/otoolep","followers_url":"https://api.github.com/users/otoolep/followers","following_url":"https://api.github.com/users/otoolep/following{/other_user}","gists_url":"https://api.github.com/users/otoolep/gists{/gist_id}","starred_url":"https://api.github.com/users/otoolep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/otoolep/subscriptions","organizations_url":"https://api.github.com/users/otoolep/orgs","repos_url":"https://api.github.com/users/otoolep/repos","events_url":"https://api.github.com/users/otoolep/events{/privacy}","received_events_url":"https://api.github.com/users/otoolep/received_events","type":"User","site_admin":false},"created_at":"2015-10-30T22:28:51Z","updated_at":"2015-10-30T22:28:51Z","body":"Actually @benbjohnson is reworking the code in the query engine, with an eye to reducing allocations. While not directly related to this issue, he points out that the profiles above show the majority time *is* spent in allocation, so we're going to attack that first. We hope to have significantly better QE performance in the near future.\r\n\r\nSo any specific work on this issue will wait until that work is completed."}}