{"action":"created","comment":{"url":"https://api.github.com/repos/cakephp/cakephp/pulls/comments/74106589","id":74106589,"diff_hunk":"@@ -187,26 +187,70 @@ public function listSources($data = null) {\n \t\treturn $tables;\n \t}\n \n-/**\n- * Returns an array of the fields in given table name.\n- *\n- * @param Model|string $model Name of database table to inspect\n- * @return array Fields in table. Keys are name and type\n- */\n-\tpublic function describe($model) {\n-\t\t$table = $this->fullTableName($model, false, false);\n-\t\t$fields = parent::describe($table);\n-\t\t$this->_sequenceMap[$table] = array();\n-\t\t$cols = null;\n-\n-\t\tif ($fields === null) {\n-\t\t\t$cols = $this->_execute(\n-\t\t\t\t\"SELECT DISTINCT table_schema AS schema, column_name AS name, data_type AS type, is_nullable AS null,\n-\t\t\t\t\tcolumn_default AS default, ordinal_position AS position, character_maximum_length AS char_length,\n-\t\t\t\t\tcharacter_octet_length AS oct_length FROM information_schema.columns\n-\t\t\t\tWHERE table_name = ? AND table_schema = ?  ORDER BY position\",\n-\t\t\t\tarray($table, $this->config['schema'])\n-\t\t\t);\n+    /**\n+     * Returns an array of the fields in given table name.\n+     *\n+     * @param Model|string $model Name of database table to inspect\n+     * @return array Fields in table. Keys are name and type\n+     */\n+    \tpublic function describe($model) {\n+    \t\t$table = $this->fullTableName($model, false, false);\n+    \t\t$fields = parent::describe($table);\n+    \t\t$this->_sequenceMap[$table] = array();\n+    \t\t$cols = null;\n+    \t\tif ($fields === null) {","path":"lib/Cake/Model/Datasource/Database/Postgres.php","position":35,"original_position":35,"commit_id":"dcbe27e99e3193c8639674ba2f252fb23a9fbe73","original_commit_id":"dcbe27e99e3193c8639674ba2f252fb23a9fbe73","user":{"login":"stickler-ci","id":16011037,"avatar_url":"https://avatars.githubusercontent.com/u/16011037?v=3","gravatar_id":"","url":"https://api.github.com/users/stickler-ci","html_url":"https://github.com/stickler-ci","followers_url":"https://api.github.com/users/stickler-ci/followers","following_url":"https://api.github.com/users/stickler-ci/following{/other_user}","gists_url":"https://api.github.com/users/stickler-ci/gists{/gist_id}","starred_url":"https://api.github.com/users/stickler-ci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stickler-ci/subscriptions","organizations_url":"https://api.github.com/users/stickler-ci/orgs","repos_url":"https://api.github.com/users/stickler-ci/repos","events_url":"https://api.github.com/users/stickler-ci/events{/privacy}","received_events_url":"https://api.github.com/users/stickler-ci/received_events","type":"User","site_admin":false},"body":"Spaces must be used to indent lines; tabs are not allowed\nLine indented incorrectly; expected 8 spaces, found 12","created_at":"2016-08-09T17:38:47Z","updated_at":"2016-08-09T17:38:47Z","html_url":"https://github.com/cakephp/cakephp/pull/9242#discussion_r74106589","pull_request_url":"https://api.github.com/repos/cakephp/cakephp/pulls/9242","_links":{"self":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/comments/74106589"},"html":{"href":"https://github.com/cakephp/cakephp/pull/9242#discussion_r74106589"},"pull_request":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/9242"}}},"pull_request":{"url":"https://api.github.com/repos/cakephp/cakephp/pulls/9242","id":80659512,"html_url":"https://github.com/cakephp/cakephp/pull/9242","diff_url":"https://github.com/cakephp/cakephp/pull/9242.diff","patch_url":"https://github.com/cakephp/cakephp/pull/9242.patch","issue_url":"https://api.github.com/repos/cakephp/cakephp/issues/9242","number":9242,"state":"open","locked":false,"title":"Update postgres.php describe to avoid information_schema.columns","user":{"login":"davidkmoat","id":20443177,"avatar_url":"https://avatars.githubusercontent.com/u/20443177?v=3","gravatar_id":"","url":"https://api.github.com/users/davidkmoat","html_url":"https://github.com/davidkmoat","followers_url":"https://api.github.com/users/davidkmoat/followers","following_url":"https://api.github.com/users/davidkmoat/following{/other_user}","gists_url":"https://api.github.com/users/davidkmoat/gists{/gist_id}","starred_url":"https://api.github.com/users/davidkmoat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidkmoat/subscriptions","organizations_url":"https://api.github.com/users/davidkmoat/orgs","repos_url":"https://api.github.com/users/davidkmoat/repos","events_url":"https://api.github.com/users/davidkmoat/events{/privacy}","received_events_url":"https://api.github.com/users/davidkmoat/received_events","type":"User","site_admin":false},"body":"Calls to information_schema.columns directly had significant overhead causing slowdowns, using a cte to filter by the schema and table name before joining to other relations (joins are the same as in information_schema.columns with a couple unneeded ones eliminated) speeds the queries significantly (in some cases we got a more than 1000x speedup of the query).\r\nOne note: only Postgres versions with support for with clauses will be able to use this query, meaning anything past I believe 8.4. ","created_at":"2016-08-09T17:17:04Z","updated_at":"2016-08-09T17:38:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8fbfb2dcb903f61e4d3b83608825641efc80028b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/cakephp/cakephp/pulls/9242/commits","review_comments_url":"https://api.github.com/repos/cakephp/cakephp/pulls/9242/comments","review_comment_url":"https://api.github.com/repos/cakephp/cakephp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cakephp/cakephp/issues/9242/comments","statuses_url":"https://api.github.com/repos/cakephp/cakephp/statuses/dcbe27e99e3193c8639674ba2f252fb23a9fbe73","head":{"label":"davidkmoat:2.next","ref":"2.next","sha":"dcbe27e99e3193c8639674ba2f252fb23a9fbe73","user":{"login":"davidkmoat","id":20443177,"avatar_url":"https://avatars.githubusercontent.com/u/20443177?v=3","gravatar_id":"","url":"https://api.github.com/users/davidkmoat","html_url":"https://github.com/davidkmoat","followers_url":"https://api.github.com/users/davidkmoat/followers","following_url":"https://api.github.com/users/davidkmoat/following{/other_user}","gists_url":"https://api.github.com/users/davidkmoat/gists{/gist_id}","starred_url":"https://api.github.com/users/davidkmoat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidkmoat/subscriptions","organizations_url":"https://api.github.com/users/davidkmoat/orgs","repos_url":"https://api.github.com/users/davidkmoat/repos","events_url":"https://api.github.com/users/davidkmoat/events{/privacy}","received_events_url":"https://api.github.com/users/davidkmoat/received_events","type":"User","site_admin":false},"repo":{"id":65312141,"name":"cakephp","full_name":"davidkmoat/cakephp","owner":{"login":"davidkmoat","id":20443177,"avatar_url":"https://avatars.githubusercontent.com/u/20443177?v=3","gravatar_id":"","url":"https://api.github.com/users/davidkmoat","html_url":"https://github.com/davidkmoat","followers_url":"https://api.github.com/users/davidkmoat/followers","following_url":"https://api.github.com/users/davidkmoat/following{/other_user}","gists_url":"https://api.github.com/users/davidkmoat/gists{/gist_id}","starred_url":"https://api.github.com/users/davidkmoat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidkmoat/subscriptions","organizations_url":"https://api.github.com/users/davidkmoat/orgs","repos_url":"https://api.github.com/users/davidkmoat/repos","events_url":"https://api.github.com/users/davidkmoat/events{/privacy}","received_events_url":"https://api.github.com/users/davidkmoat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/davidkmoat/cakephp","description":"CakePHP: The Rapid Development Framework for PHP - Official Repository","fork":true,"url":"https://api.github.com/repos/davidkmoat/cakephp","forks_url":"https://api.github.com/repos/davidkmoat/cakephp/forks","keys_url":"https://api.github.com/repos/davidkmoat/cakephp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/davidkmoat/cakephp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/davidkmoat/cakephp/teams","hooks_url":"https://api.github.com/repos/davidkmoat/cakephp/hooks","issue_events_url":"https://api.github.com/repos/davidkmoat/cakephp/issues/events{/number}","events_url":"https://api.github.com/repos/davidkmoat/cakephp/events","assignees_url":"https://api.github.com/repos/davidkmoat/cakephp/assignees{/user}","branches_url":"https://api.github.com/repos/davidkmoat/cakephp/branches{/branch}","tags_url":"https://api.github.com/repos/davidkmoat/cakephp/tags","blobs_url":"https://api.github.com/repos/davidkmoat/cakephp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/davidkmoat/cakephp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/davidkmoat/cakephp/git/refs{/sha}","trees_url":"https://api.github.com/repos/davidkmoat/cakephp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/davidkmoat/cakephp/statuses/{sha}","languages_url":"https://api.github.com/repos/davidkmoat/cakephp/languages","stargazers_url":"https://api.github.com/repos/davidkmoat/cakephp/stargazers","contributors_url":"https://api.github.com/repos/davidkmoat/cakephp/contributors","subscribers_url":"https://api.github.com/repos/davidkmoat/cakephp/subscribers","subscription_url":"https://api.github.com/repos/davidkmoat/cakephp/subscription","commits_url":"https://api.github.com/repos/davidkmoat/cakephp/commits{/sha}","git_commits_url":"https://api.github.com/repos/davidkmoat/cakephp/git/commits{/sha}","comments_url":"https://api.github.com/repos/davidkmoat/cakephp/comments{/number}","issue_comment_url":"https://api.github.com/repos/davidkmoat/cakephp/issues/comments{/number}","contents_url":"https://api.github.com/repos/davidkmoat/cakephp/contents/{+path}","compare_url":"https://api.github.com/repos/davidkmoat/cakephp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/davidkmoat/cakephp/merges","archive_url":"https://api.github.com/repos/davidkmoat/cakephp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/davidkmoat/cakephp/downloads","issues_url":"https://api.github.com/repos/davidkmoat/cakephp/issues{/number}","pulls_url":"https://api.github.com/repos/davidkmoat/cakephp/pulls{/number}","milestones_url":"https://api.github.com/repos/davidkmoat/cakephp/milestones{/number}","notifications_url":"https://api.github.com/repos/davidkmoat/cakephp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/davidkmoat/cakephp/labels{/name}","releases_url":"https://api.github.com/repos/davidkmoat/cakephp/releases{/id}","deployments_url":"https://api.github.com/repos/davidkmoat/cakephp/deployments","created_at":"2016-08-09T16:50:28Z","updated_at":"2016-08-09T16:50:36Z","pushed_at":"2016-08-09T17:38:23Z","git_url":"git://github.com/davidkmoat/cakephp.git","ssh_url":"git@github.com:davidkmoat/cakephp.git","clone_url":"https://github.com/davidkmoat/cakephp.git","svn_url":"https://github.com/davidkmoat/cakephp","homepage":"http://cakephp.org","size":128950,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"cakephp:2.next","ref":"2.next","sha":"feea55dc22bd8f640ec92e44856478a199d07e61","user":{"login":"cakephp","id":23666,"avatar_url":"https://avatars.githubusercontent.com/u/23666?v=3","gravatar_id":"","url":"https://api.github.com/users/cakephp","html_url":"https://github.com/cakephp","followers_url":"https://api.github.com/users/cakephp/followers","following_url":"https://api.github.com/users/cakephp/following{/other_user}","gists_url":"https://api.github.com/users/cakephp/gists{/gist_id}","starred_url":"https://api.github.com/users/cakephp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cakephp/subscriptions","organizations_url":"https://api.github.com/users/cakephp/orgs","repos_url":"https://api.github.com/users/cakephp/repos","events_url":"https://api.github.com/users/cakephp/events{/privacy}","received_events_url":"https://api.github.com/users/cakephp/received_events","type":"Organization","site_admin":false},"repo":{"id":656494,"name":"cakephp","full_name":"cakephp/cakephp","owner":{"login":"cakephp","id":23666,"avatar_url":"https://avatars.githubusercontent.com/u/23666?v=3","gravatar_id":"","url":"https://api.github.com/users/cakephp","html_url":"https://github.com/cakephp","followers_url":"https://api.github.com/users/cakephp/followers","following_url":"https://api.github.com/users/cakephp/following{/other_user}","gists_url":"https://api.github.com/users/cakephp/gists{/gist_id}","starred_url":"https://api.github.com/users/cakephp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cakephp/subscriptions","organizations_url":"https://api.github.com/users/cakephp/orgs","repos_url":"https://api.github.com/users/cakephp/repos","events_url":"https://api.github.com/users/cakephp/events{/privacy}","received_events_url":"https://api.github.com/users/cakephp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cakephp/cakephp","description":"CakePHP: The Rapid Development Framework for PHP - Official Repository","fork":false,"url":"https://api.github.com/repos/cakephp/cakephp","forks_url":"https://api.github.com/repos/cakephp/cakephp/forks","keys_url":"https://api.github.com/repos/cakephp/cakephp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cakephp/cakephp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cakephp/cakephp/teams","hooks_url":"https://api.github.com/repos/cakephp/cakephp/hooks","issue_events_url":"https://api.github.com/repos/cakephp/cakephp/issues/events{/number}","events_url":"https://api.github.com/repos/cakephp/cakephp/events","assignees_url":"https://api.github.com/repos/cakephp/cakephp/assignees{/user}","branches_url":"https://api.github.com/repos/cakephp/cakephp/branches{/branch}","tags_url":"https://api.github.com/repos/cakephp/cakephp/tags","blobs_url":"https://api.github.com/repos/cakephp/cakephp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cakephp/cakephp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cakephp/cakephp/git/refs{/sha}","trees_url":"https://api.github.com/repos/cakephp/cakephp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cakephp/cakephp/statuses/{sha}","languages_url":"https://api.github.com/repos/cakephp/cakephp/languages","stargazers_url":"https://api.github.com/repos/cakephp/cakephp/stargazers","contributors_url":"https://api.github.com/repos/cakephp/cakephp/contributors","subscribers_url":"https://api.github.com/repos/cakephp/cakephp/subscribers","subscription_url":"https://api.github.com/repos/cakephp/cakephp/subscription","commits_url":"https://api.github.com/repos/cakephp/cakephp/commits{/sha}","git_commits_url":"https://api.github.com/repos/cakephp/cakephp/git/commits{/sha}","comments_url":"https://api.github.com/repos/cakephp/cakephp/comments{/number}","issue_comment_url":"https://api.github.com/repos/cakephp/cakephp/issues/comments{/number}","contents_url":"https://api.github.com/repos/cakephp/cakephp/contents/{+path}","compare_url":"https://api.github.com/repos/cakephp/cakephp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cakephp/cakephp/merges","archive_url":"https://api.github.com/repos/cakephp/cakephp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cakephp/cakephp/downloads","issues_url":"https://api.github.com/repos/cakephp/cakephp/issues{/number}","pulls_url":"https://api.github.com/repos/cakephp/cakephp/pulls{/number}","milestones_url":"https://api.github.com/repos/cakephp/cakephp/milestones{/number}","notifications_url":"https://api.github.com/repos/cakephp/cakephp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cakephp/cakephp/labels{/name}","releases_url":"https://api.github.com/repos/cakephp/cakephp/releases{/id}","deployments_url":"https://api.github.com/repos/cakephp/cakephp/deployments","created_at":"2010-05-08T14:38:22Z","updated_at":"2016-08-09T12:39:20Z","pushed_at":"2016-08-09T17:38:24Z","git_url":"git://github.com/cakephp/cakephp.git","ssh_url":"git@github.com:cakephp/cakephp.git","clone_url":"https://github.com/cakephp/cakephp.git","svn_url":"https://github.com/cakephp/cakephp","homepage":"http://cakephp.org","size":128935,"stargazers_count":6643,"watchers_count":6643,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3015,"mirror_url":null,"open_issues_count":200,"forks":3015,"open_issues":200,"watchers":6643,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/9242"},"html":{"href":"https://github.com/cakephp/cakephp/pull/9242"},"issue":{"href":"https://api.github.com/repos/cakephp/cakephp/issues/9242"},"comments":{"href":"https://api.github.com/repos/cakephp/cakephp/issues/9242/comments"},"review_comments":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/9242/comments"},"review_comment":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/9242/commits"},"statuses":{"href":"https://api.github.com/repos/cakephp/cakephp/statuses/dcbe27e99e3193c8639674ba2f252fb23a9fbe73"}}}}
{"actor":{"display_login":"stickler-ci"}}