{"action":"created","issue":{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/4337","labels_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/4337/labels{/name}","comments_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/4337/comments","events_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/4337/events","html_url":"https://github.com/rethinkdb/rethinkdb/issues/4337","id":84698663,"number":4337,"title":"Distinct is very slow","user":{"login":"Cidan","id":1133628,"avatar_url":"https://avatars.githubusercontent.com/u/1133628?v=3","gravatar_id":"","url":"https://api.github.com/users/Cidan","html_url":"https://github.com/Cidan","followers_url":"https://api.github.com/users/Cidan/followers","following_url":"https://api.github.com/users/Cidan/following{/other_user}","gists_url":"https://api.github.com/users/Cidan/gists{/gist_id}","starred_url":"https://api.github.com/users/Cidan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cidan/subscriptions","organizations_url":"https://api.github.com/users/Cidan/orgs","repos_url":"https://api.github.com/users/Cidan/repos","events_url":"https://api.github.com/users/Cidan/events{/privacy}","received_events_url":"https://api.github.com/users/Cidan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/labels/tp:performance","name":"tp:performance","color":"444444"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-03T18:14:18Z","updated_at":"2015-07-09T20:13:33Z","closed_at":"2015-07-09T20:13:33Z","body":"When running the following query on the web UI, the request simply times out after 300 seconds:\r\n\r\n```\r\nr.db('test_table').table('images').distinct({index: 'tag'}).count()\r\n\r\n```\r\n\r\nThe dataset is 9.4 million rows at about 8 gigs, all of which fits into memory. The machine is a fairly powerful EC2 box, c4.2xlarge, and all CPU cores are almost entirely idle. The dataset is sitting on an SSD.\r\n\r\nLet me know what else I can provide. Thanks."},"comment":{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/comments/120132563","html_url":"https://github.com/rethinkdb/rethinkdb/issues/4337#issuecomment-120132563","issue_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/4337","id":120132563,"user":{"login":"danielmewes","id":505365,"avatar_url":"https://avatars.githubusercontent.com/u/505365?v=3","gravatar_id":"","url":"https://api.github.com/users/danielmewes","html_url":"https://github.com/danielmewes","followers_url":"https://api.github.com/users/danielmewes/followers","following_url":"https://api.github.com/users/danielmewes/following{/other_user}","gists_url":"https://api.github.com/users/danielmewes/gists{/gist_id}","starred_url":"https://api.github.com/users/danielmewes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielmewes/subscriptions","organizations_url":"https://api.github.com/users/danielmewes/orgs","repos_url":"https://api.github.com/users/danielmewes/repos","events_url":"https://api.github.com/users/danielmewes/events{/privacy}","received_events_url":"https://api.github.com/users/danielmewes/received_events","type":"User","site_admin":false},"created_at":"2015-07-09T20:13:33Z","updated_at":"2015-07-09T20:13:33Z","body":"No response from @Cidan about the cache size in a while. Closing for now, but feel free to re-open.\r\n\r\nThe indexes `distinct` optimization I mentioned is being tracked in https://github.com/rethinkdb/rethinkdb/issues/4342 ."}}