{"action":"created","comment":{"url":"https://api.github.com/repos/laravel/framework/pulls/comments/40492463","id":40492463,"diff_hunk":"@@ -612,6 +612,20 @@ protected function compileUnion(array $union)\n     }\n \n     /**\n+     * Compile an exists statement into SQL.\n+     *\n+     * @param \\Illuminate\\Database\\Query\\Builder $query\n+     *\n+     * @return string\n+     */\n+    public function compileExists(Builder $query)\n+    {\n+        $select = $this->compileSelect($query);","path":"src/Illuminate/Database/Query/Grammars/Grammar.php","position":12,"original_position":12,"commit_id":"1d58ce121eee16e50ef4656e0d421378ecaadf26","original_commit_id":"1d58ce121eee16e50ef4656e0d421378ecaadf26","user":{"login":"xiphiaz","id":721513,"avatar_url":"https://avatars.githubusercontent.com/u/721513?v=3","gravatar_id":"","url":"https://api.github.com/users/xiphiaz","html_url":"https://github.com/xiphiaz","followers_url":"https://api.github.com/users/xiphiaz/followers","following_url":"https://api.github.com/users/xiphiaz/following{/other_user}","gists_url":"https://api.github.com/users/xiphiaz/gists{/gist_id}","starred_url":"https://api.github.com/users/xiphiaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiphiaz/subscriptions","organizations_url":"https://api.github.com/users/xiphiaz/orgs","repos_url":"https://api.github.com/users/xiphiaz/repos","events_url":"https://api.github.com/users/xiphiaz/events{/privacy}","received_events_url":"https://api.github.com/users/xiphiaz/received_events","type":"User","site_admin":false},"body":"Oh really? Ok that makes sense then.","created_at":"2015-09-26T10:28:58Z","updated_at":"2015-09-26T10:28:58Z","html_url":"https://github.com/laravel/framework/pull/10373#discussion_r40492463","pull_request_url":"https://api.github.com/repos/laravel/framework/pulls/10373","_links":{"self":{"href":"https://api.github.com/repos/laravel/framework/pulls/comments/40492463"},"html":{"href":"https://github.com/laravel/framework/pull/10373#discussion_r40492463"},"pull_request":{"href":"https://api.github.com/repos/laravel/framework/pulls/10373"}}},"pull_request":{"url":"https://api.github.com/repos/laravel/framework/pulls/10373","id":45962321,"html_url":"https://github.com/laravel/framework/pull/10373","diff_url":"https://github.com/laravel/framework/pull/10373.diff","patch_url":"https://github.com/laravel/framework/pull/10373.patch","issue_url":"https://api.github.com/repos/laravel/framework/issues/10373","number":10373,"state":"open","locked":false,"title":"[5.1] Improve exists queries","user":{"login":"HipsterJazzbo","id":231361,"avatar_url":"https://avatars.githubusercontent.com/u/231361?v=3","gravatar_id":"","url":"https://api.github.com/users/HipsterJazzbo","html_url":"https://github.com/HipsterJazzbo","followers_url":"https://api.github.com/users/HipsterJazzbo/followers","following_url":"https://api.github.com/users/HipsterJazzbo/following{/other_user}","gists_url":"https://api.github.com/users/HipsterJazzbo/gists{/gist_id}","starred_url":"https://api.github.com/users/HipsterJazzbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HipsterJazzbo/subscriptions","organizations_url":"https://api.github.com/users/HipsterJazzbo/orgs","repos_url":"https://api.github.com/users/HipsterJazzbo/repos","events_url":"https://api.github.com/users/HipsterJazzbo/events{/privacy}","received_events_url":"https://api.github.com/users/HipsterJazzbo/received_events","type":"User","site_admin":false},"body":"As [suggested](https://larachat.slack.com/archives/internals/p1443124679002492) by @JosephSilber, this updates the `exists()` query builder method to do an actual `exists` query, which should be much faster for big tables.\r\n\r\n**Edit:** I have tested this on MySQL, Postgres, and SQLite. I don't have a SQLServer lying around to test on, but the docs show that it should work fine.","created_at":"2015-09-24T23:27:39Z","updated_at":"2015-09-26T10:28:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"349dbdfb2abd0f6de2ac277120c8b0353b1f758f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/laravel/framework/pulls/10373/commits","review_comments_url":"https://api.github.com/repos/laravel/framework/pulls/10373/comments","review_comment_url":"https://api.github.com/repos/laravel/framework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/laravel/framework/issues/10373/comments","statuses_url":"https://api.github.com/repos/laravel/framework/statuses/1d58ce121eee16e50ef4656e0d421378ecaadf26","head":{"label":"HipsterJazzbo:5.1-improve-exists-queries","ref":"5.1-improve-exists-queries","sha":"1d58ce121eee16e50ef4656e0d421378ecaadf26","user":{"login":"HipsterJazzbo","id":231361,"avatar_url":"https://avatars.githubusercontent.com/u/231361?v=3","gravatar_id":"","url":"https://api.github.com/users/HipsterJazzbo","html_url":"https://github.com/HipsterJazzbo","followers_url":"https://api.github.com/users/HipsterJazzbo/followers","following_url":"https://api.github.com/users/HipsterJazzbo/following{/other_user}","gists_url":"https://api.github.com/users/HipsterJazzbo/gists{/gist_id}","starred_url":"https://api.github.com/users/HipsterJazzbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HipsterJazzbo/subscriptions","organizations_url":"https://api.github.com/users/HipsterJazzbo/orgs","repos_url":"https://api.github.com/users/HipsterJazzbo/repos","events_url":"https://api.github.com/users/HipsterJazzbo/events{/privacy}","received_events_url":"https://api.github.com/users/HipsterJazzbo/received_events","type":"User","site_admin":false},"repo":{"id":21190721,"name":"framework","full_name":"HipsterJazzbo/framework","owner":{"login":"HipsterJazzbo","id":231361,"avatar_url":"https://avatars.githubusercontent.com/u/231361?v=3","gravatar_id":"","url":"https://api.github.com/users/HipsterJazzbo","html_url":"https://github.com/HipsterJazzbo","followers_url":"https://api.github.com/users/HipsterJazzbo/followers","following_url":"https://api.github.com/users/HipsterJazzbo/following{/other_user}","gists_url":"https://api.github.com/users/HipsterJazzbo/gists{/gist_id}","starred_url":"https://api.github.com/users/HipsterJazzbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HipsterJazzbo/subscriptions","organizations_url":"https://api.github.com/users/HipsterJazzbo/orgs","repos_url":"https://api.github.com/users/HipsterJazzbo/repos","events_url":"https://api.github.com/users/HipsterJazzbo/events{/privacy}","received_events_url":"https://api.github.com/users/HipsterJazzbo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/HipsterJazzbo/framework","description":"","fork":true,"url":"https://api.github.com/repos/HipsterJazzbo/framework","forks_url":"https://api.github.com/repos/HipsterJazzbo/framework/forks","keys_url":"https://api.github.com/repos/HipsterJazzbo/framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HipsterJazzbo/framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HipsterJazzbo/framework/teams","hooks_url":"https://api.github.com/repos/HipsterJazzbo/framework/hooks","issue_events_url":"https://api.github.com/repos/HipsterJazzbo/framework/issues/events{/number}","events_url":"https://api.github.com/repos/HipsterJazzbo/framework/events","assignees_url":"https://api.github.com/repos/HipsterJazzbo/framework/assignees{/user}","branches_url":"https://api.github.com/repos/HipsterJazzbo/framework/branches{/branch}","tags_url":"https://api.github.com/repos/HipsterJazzbo/framework/tags","blobs_url":"https://api.github.com/repos/HipsterJazzbo/framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HipsterJazzbo/framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HipsterJazzbo/framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/HipsterJazzbo/framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HipsterJazzbo/framework/statuses/{sha}","languages_url":"https://api.github.com/repos/HipsterJazzbo/framework/languages","stargazers_url":"https://api.github.com/repos/HipsterJazzbo/framework/stargazers","contributors_url":"https://api.github.com/repos/HipsterJazzbo/framework/contributors","subscribers_url":"https://api.github.com/repos/HipsterJazzbo/framework/subscribers","subscription_url":"https://api.github.com/repos/HipsterJazzbo/framework/subscription","commits_url":"https://api.github.com/repos/HipsterJazzbo/framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/HipsterJazzbo/framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/HipsterJazzbo/framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/HipsterJazzbo/framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/HipsterJazzbo/framework/contents/{+path}","compare_url":"https://api.github.com/repos/HipsterJazzbo/framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HipsterJazzbo/framework/merges","archive_url":"https://api.github.com/repos/HipsterJazzbo/framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HipsterJazzbo/framework/downloads","issues_url":"https://api.github.com/repos/HipsterJazzbo/framework/issues{/number}","pulls_url":"https://api.github.com/repos/HipsterJazzbo/framework/pulls{/number}","milestones_url":"https://api.github.com/repos/HipsterJazzbo/framework/milestones{/number}","notifications_url":"https://api.github.com/repos/HipsterJazzbo/framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HipsterJazzbo/framework/labels{/name}","releases_url":"https://api.github.com/repos/HipsterJazzbo/framework/releases{/id}","created_at":"2014-06-25T04:52:38Z","updated_at":"2015-02-19T03:16:39Z","pushed_at":"2015-09-25T07:55:43Z","git_url":"git://github.com/HipsterJazzbo/framework.git","ssh_url":"git@github.com:HipsterJazzbo/framework.git","clone_url":"https://github.com/HipsterJazzbo/framework.git","svn_url":"https://github.com/HipsterJazzbo/framework","homepage":"http://laravel.com","size":18768,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"laravel:5.1","ref":"5.1","sha":"e924d11dc30ed90a3e3f794b5170690f27b4e2c0","user":{"login":"laravel","id":958072,"avatar_url":"https://avatars.githubusercontent.com/u/958072?v=3","gravatar_id":"","url":"https://api.github.com/users/laravel","html_url":"https://github.com/laravel","followers_url":"https://api.github.com/users/laravel/followers","following_url":"https://api.github.com/users/laravel/following{/other_user}","gists_url":"https://api.github.com/users/laravel/gists{/gist_id}","starred_url":"https://api.github.com/users/laravel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laravel/subscriptions","organizations_url":"https://api.github.com/users/laravel/orgs","repos_url":"https://api.github.com/users/laravel/repos","events_url":"https://api.github.com/users/laravel/events{/privacy}","received_events_url":"https://api.github.com/users/laravel/received_events","type":"Organization","site_admin":false},"repo":{"id":7548986,"name":"framework","full_name":"laravel/framework","owner":{"login":"laravel","id":958072,"avatar_url":"https://avatars.githubusercontent.com/u/958072?v=3","gravatar_id":"","url":"https://api.github.com/users/laravel","html_url":"https://github.com/laravel","followers_url":"https://api.github.com/users/laravel/followers","following_url":"https://api.github.com/users/laravel/following{/other_user}","gists_url":"https://api.github.com/users/laravel/gists{/gist_id}","starred_url":"https://api.github.com/users/laravel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laravel/subscriptions","organizations_url":"https://api.github.com/users/laravel/orgs","repos_url":"https://api.github.com/users/laravel/repos","events_url":"https://api.github.com/users/laravel/events{/privacy}","received_events_url":"https://api.github.com/users/laravel/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/laravel/framework","description":"","fork":false,"url":"https://api.github.com/repos/laravel/framework","forks_url":"https://api.github.com/repos/laravel/framework/forks","keys_url":"https://api.github.com/repos/laravel/framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/laravel/framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/laravel/framework/teams","hooks_url":"https://api.github.com/repos/laravel/framework/hooks","issue_events_url":"https://api.github.com/repos/laravel/framework/issues/events{/number}","events_url":"https://api.github.com/repos/laravel/framework/events","assignees_url":"https://api.github.com/repos/laravel/framework/assignees{/user}","branches_url":"https://api.github.com/repos/laravel/framework/branches{/branch}","tags_url":"https://api.github.com/repos/laravel/framework/tags","blobs_url":"https://api.github.com/repos/laravel/framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/laravel/framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/laravel/framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/laravel/framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/laravel/framework/statuses/{sha}","languages_url":"https://api.github.com/repos/laravel/framework/languages","stargazers_url":"https://api.github.com/repos/laravel/framework/stargazers","contributors_url":"https://api.github.com/repos/laravel/framework/contributors","subscribers_url":"https://api.github.com/repos/laravel/framework/subscribers","subscription_url":"https://api.github.com/repos/laravel/framework/subscription","commits_url":"https://api.github.com/repos/laravel/framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/laravel/framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/laravel/framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/laravel/framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/laravel/framework/contents/{+path}","compare_url":"https://api.github.com/repos/laravel/framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/laravel/framework/merges","archive_url":"https://api.github.com/repos/laravel/framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/laravel/framework/downloads","issues_url":"https://api.github.com/repos/laravel/framework/issues{/number}","pulls_url":"https://api.github.com/repos/laravel/framework/pulls{/number}","milestones_url":"https://api.github.com/repos/laravel/framework/milestones{/number}","notifications_url":"https://api.github.com/repos/laravel/framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/laravel/framework/labels{/name}","releases_url":"https://api.github.com/repos/laravel/framework/releases{/id}","created_at":"2013-01-10T21:27:28Z","updated_at":"2015-09-26T09:17:35Z","pushed_at":"2015-09-25T21:16:17Z","git_url":"git://github.com/laravel/framework.git","ssh_url":"git@github.com:laravel/framework.git","clone_url":"https://github.com/laravel/framework.git","svn_url":"https://github.com/laravel/framework","homepage":"http://laravel.com","size":68637,"stargazers_count":4121,"watchers_count":4121,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2360,"mirror_url":null,"open_issues_count":67,"forks":2360,"open_issues":67,"watchers":4121,"default_branch":"5.1"}},"_links":{"self":{"href":"https://api.github.com/repos/laravel/framework/pulls/10373"},"html":{"href":"https://github.com/laravel/framework/pull/10373"},"issue":{"href":"https://api.github.com/repos/laravel/framework/issues/10373"},"comments":{"href":"https://api.github.com/repos/laravel/framework/issues/10373/comments"},"review_comments":{"href":"https://api.github.com/repos/laravel/framework/pulls/10373/comments"},"review_comment":{"href":"https://api.github.com/repos/laravel/framework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/laravel/framework/pulls/10373/commits"},"statuses":{"href":"https://api.github.com/repos/laravel/framework/statuses/1d58ce121eee16e50ef4656e0d421378ecaadf26"}}}}