{"action":"created","issue":{"url":"https://api.github.com/repos/discourse/discourse/issues/4524","repository_url":"https://api.github.com/repos/discourse/discourse","labels_url":"https://api.github.com/repos/discourse/discourse/issues/4524/labels{/name}","comments_url":"https://api.github.com/repos/discourse/discourse/issues/4524/comments","events_url":"https://api.github.com/repos/discourse/discourse/issues/4524/events","html_url":"https://github.com/discourse/discourse/pull/4524","id":186200605,"number":4524,"title":"PERF: `NOT IN` query is really inefficient when there are a lot of re…","user":{"login":"tgxworld","id":4335742,"avatar_url":"https://avatars.githubusercontent.com/u/4335742?v=3","gravatar_id":"","url":"https://api.github.com/users/tgxworld","html_url":"https://github.com/tgxworld","followers_url":"https://api.github.com/users/tgxworld/followers","following_url":"https://api.github.com/users/tgxworld/following{/other_user}","gists_url":"https://api.github.com/users/tgxworld/gists{/gist_id}","starred_url":"https://api.github.com/users/tgxworld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgxworld/subscriptions","organizations_url":"https://api.github.com/users/tgxworld/orgs","repos_url":"https://api.github.com/users/tgxworld/repos","events_url":"https://api.github.com/users/tgxworld/events{/privacy}","received_events_url":"https://api.github.com/users/tgxworld/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-10-31T04:27:10Z","updated_at":"2016-11-02T03:20:01Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/discourse/discourse/pulls/4524","html_url":"https://github.com/discourse/discourse/pull/4524","diff_url":"https://github.com/discourse/discourse/pull/4524.diff","patch_url":"https://github.com/discourse/discourse/pull/4524.patch"},"body":"…cords.\r\n\r\n@SamSaffron @ZogStriP Would love to have more eyes on this. The query currently goes through all the rows in the `uploads` table making it very expensive to run.\r\n\r\n`Array#-` under the hood will still have to iterate through all the entire array but it coverts the second array into a hash making lookups fast. "},"comment":{"url":"https://api.github.com/repos/discourse/discourse/issues/comments/257761685","html_url":"https://github.com/discourse/discourse/pull/4524#issuecomment-257761685","issue_url":"https://api.github.com/repos/discourse/discourse/issues/4524","id":257761685,"user":{"login":"tgxworld","id":4335742,"avatar_url":"https://avatars.githubusercontent.com/u/4335742?v=3","gravatar_id":"","url":"https://api.github.com/users/tgxworld","html_url":"https://github.com/tgxworld","followers_url":"https://api.github.com/users/tgxworld/followers","following_url":"https://api.github.com/users/tgxworld/following{/other_user}","gists_url":"https://api.github.com/users/tgxworld/gists{/gist_id}","starred_url":"https://api.github.com/users/tgxworld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgxworld/subscriptions","organizations_url":"https://api.github.com/users/tgxworld/orgs","repos_url":"https://api.github.com/users/tgxworld/repos","events_url":"https://api.github.com/users/tgxworld/events{/privacy}","received_events_url":"https://api.github.com/users/tgxworld/received_events","type":"User","site_admin":false},"created_at":"2016-11-02T03:20:01Z","updated_at":"2016-11-02T03:20:01Z","body":"> Looks like this query can benefit greatly from a index on created_at field.\r\n@xfalcox  I tried this out locally and it seems like Postgres will still decide to do a seq scan even with an index on `created_at`"}}
{"actor":{"display_login":"tgxworld"}}