{"action":"created","comment":{"url":"https://api.github.com/repos/pingcap/tidb/pulls/comments/140263466","pull_request_review_id":64308531,"id":140263466,"diff_hunk":"@@ -227,16 +227,15 @@ func DecodeColumnValue(data []byte, ft *types.FieldType, loc *time.Location) (ty\n \treturn colDatum, nil\n }\n \n-// DecodeRow decodes a byte slice into datums.\n+// DecodeRowWithMap decodes a byte slice into datums with a existing row map.\n // Row layout: colID1, value1, colID2, value2, .....\n-func DecodeRow(b []byte, cols map[int64]*types.FieldType, loc *time.Location) (map[int64]types.Datum, error) {\n-\tif b == nil {\n+func DecodeRowWithMap(b []byte, cols map[int64]*types.FieldType, loc *time.Location, row map[int64]types.Datum) (map[int64]types.Datum, error) {\n+\tif row == nil || b == nil {","path":"tablecodec/tablecodec.go","position":10,"original_position":10,"commit_id":"5bd1d04bba83fb9ef1e68d281ea7503d6f00f479","original_commit_id":"5bd1d04bba83fb9ef1e68d281ea7503d6f00f479","user":{"login":"coocood","id":891222,"avatar_url":"https://avatars0.githubusercontent.com/u/891222?v=4","gravatar_id":"","url":"https://api.github.com/users/coocood","html_url":"https://github.com/coocood","followers_url":"https://api.github.com/users/coocood/followers","following_url":"https://api.github.com/users/coocood/following{/other_user}","gists_url":"https://api.github.com/users/coocood/gists{/gist_id}","starred_url":"https://api.github.com/users/coocood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coocood/subscriptions","organizations_url":"https://api.github.com/users/coocood/orgs","repos_url":"https://api.github.com/users/coocood/repos","events_url":"https://api.github.com/users/coocood/events{/privacy}","received_events_url":"https://api.github.com/users/coocood/received_events","type":"User","site_admin":false},"body":"How about creating the map if `row` is nil at line 239?\r\nThen we don't need to create the map in `DecodeRow`.\r\n\r\nOr we just remove `DecodeRow`, use `DecodeRowWithMap` instead?\r\nOr adding an argument `row` to `DecodeRow`?","created_at":"2017-09-21T14:46:41Z","updated_at":"2017-09-21T14:52:54Z","html_url":"https://github.com/pingcap/tidb/pull/4579#discussion_r140263466","pull_request_url":"https://api.github.com/repos/pingcap/tidb/pulls/4579","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/comments/140263466"},"html":{"href":"https://github.com/pingcap/tidb/pull/4579#discussion_r140263466"},"pull_request":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/4579"}}},"pull_request":{"url":"https://api.github.com/repos/pingcap/tidb/pulls/4579","id":141880939,"html_url":"https://github.com/pingcap/tidb/pull/4579","diff_url":"https://github.com/pingcap/tidb/pull/4579.diff","patch_url":"https://github.com/pingcap/tidb/pull/4579.patch","issue_url":"https://api.github.com/repos/pingcap/tidb/issues/4579","number":4579,"state":"open","locked":false,"title":"*: Speed up the add index operation","user":{"login":"zimulala","id":4242506,"avatar_url":"https://avatars2.githubusercontent.com/u/4242506?v=4","gravatar_id":"","url":"https://api.github.com/users/zimulala","html_url":"https://github.com/zimulala","followers_url":"https://api.github.com/users/zimulala/followers","following_url":"https://api.github.com/users/zimulala/following{/other_user}","gists_url":"https://api.github.com/users/zimulala/gists{/gist_id}","starred_url":"https://api.github.com/users/zimulala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zimulala/subscriptions","organizations_url":"https://api.github.com/users/zimulala/orgs","repos_url":"https://api.github.com/users/zimulala/repos","events_url":"https://api.github.com/users/zimulala/events{/privacy}","received_events_url":"https://api.github.com/users/zimulala/received_events","type":"User","site_admin":false},"body":"Using 4 TiKV, 1 PD, 2 TiDB , the servers of TiKV and TiDB are not on a computer.\r\nThe number of records in this table is 100,000,000, and the table's structure is as follows:\r\n CREATE TABLE `tt` ( \r\n `a` int(11) DEFAULT NULL,\r\n  `b` varchar(256) DEFAULT NULL,\r\n  `c` varchar(256) DEFAULT NULL,\r\n  `d` int(11) DEFAULT NULL,\r\n  `e` int(11) DEFAULT NULL,\r\n  `f` int(11) DEFAULT NULL)ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin\r\n\r\ntidb-before: adding an index e takes time 44m33.015285749s\r\ntidb-current: adding an index f takes time 35m33.008533773s","created_at":"2017-09-19T15:25:12Z","updated_at":"2017-09-21T14:52:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4cfca7f786d6ab451edb8571da6aef00cc0e7e08","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/pingcap/tidb/pulls/4579/commits","review_comments_url":"https://api.github.com/repos/pingcap/tidb/pulls/4579/comments","review_comment_url":"https://api.github.com/repos/pingcap/tidb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pingcap/tidb/issues/4579/comments","statuses_url":"https://api.github.com/repos/pingcap/tidb/statuses/5bd1d04bba83fb9ef1e68d281ea7503d6f00f479","head":{"label":"pingcap:zimuxia/speedup-idx-1","ref":"zimuxia/speedup-idx-1","sha":"5bd1d04bba83fb9ef1e68d281ea7503d6f00f479","user":{"login":"pingcap","id":11855343,"avatar_url":"https://avatars3.githubusercontent.com/u/11855343?v=4","gravatar_id":"","url":"https://api.github.com/users/pingcap","html_url":"https://github.com/pingcap","followers_url":"https://api.github.com/users/pingcap/followers","following_url":"https://api.github.com/users/pingcap/following{/other_user}","gists_url":"https://api.github.com/users/pingcap/gists{/gist_id}","starred_url":"https://api.github.com/users/pingcap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingcap/subscriptions","organizations_url":"https://api.github.com/users/pingcap/orgs","repos_url":"https://api.github.com/users/pingcap/repos","events_url":"https://api.github.com/users/pingcap/events{/privacy}","received_events_url":"https://api.github.com/users/pingcap/received_events","type":"Organization","site_admin":false},"repo":{"id":41986369,"name":"tidb","full_name":"pingcap/tidb","owner":{"login":"pingcap","id":11855343,"avatar_url":"https://avatars3.githubusercontent.com/u/11855343?v=4","gravatar_id":"","url":"https://api.github.com/users/pingcap","html_url":"https://github.com/pingcap","followers_url":"https://api.github.com/users/pingcap/followers","following_url":"https://api.github.com/users/pingcap/following{/other_user}","gists_url":"https://api.github.com/users/pingcap/gists{/gist_id}","starred_url":"https://api.github.com/users/pingcap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingcap/subscriptions","organizations_url":"https://api.github.com/users/pingcap/orgs","repos_url":"https://api.github.com/users/pingcap/repos","events_url":"https://api.github.com/users/pingcap/events{/privacy}","received_events_url":"https://api.github.com/users/pingcap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pingcap/tidb","description":"TiDB is a distributed NewSQL database compatible with MySQL protocol ","fork":false,"url":"https://api.github.com/repos/pingcap/tidb","forks_url":"https://api.github.com/repos/pingcap/tidb/forks","keys_url":"https://api.github.com/repos/pingcap/tidb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pingcap/tidb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pingcap/tidb/teams","hooks_url":"https://api.github.com/repos/pingcap/tidb/hooks","issue_events_url":"https://api.github.com/repos/pingcap/tidb/issues/events{/number}","events_url":"https://api.github.com/repos/pingcap/tidb/events","assignees_url":"https://api.github.com/repos/pingcap/tidb/assignees{/user}","branches_url":"https://api.github.com/repos/pingcap/tidb/branches{/branch}","tags_url":"https://api.github.com/repos/pingcap/tidb/tags","blobs_url":"https://api.github.com/repos/pingcap/tidb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pingcap/tidb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pingcap/tidb/git/refs{/sha}","trees_url":"https://api.github.com/repos/pingcap/tidb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pingcap/tidb/statuses/{sha}","languages_url":"https://api.github.com/repos/pingcap/tidb/languages","stargazers_url":"https://api.github.com/repos/pingcap/tidb/stargazers","contributors_url":"https://api.github.com/repos/pingcap/tidb/contributors","subscribers_url":"https://api.github.com/repos/pingcap/tidb/subscribers","subscription_url":"https://api.github.com/repos/pingcap/tidb/subscription","commits_url":"https://api.github.com/repos/pingcap/tidb/commits{/sha}","git_commits_url":"https://api.github.com/repos/pingcap/tidb/git/commits{/sha}","comments_url":"https://api.github.com/repos/pingcap/tidb/comments{/number}","issue_comment_url":"https://api.github.com/repos/pingcap/tidb/issues/comments{/number}","contents_url":"https://api.github.com/repos/pingcap/tidb/contents/{+path}","compare_url":"https://api.github.com/repos/pingcap/tidb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pingcap/tidb/merges","archive_url":"https://api.github.com/repos/pingcap/tidb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pingcap/tidb/downloads","issues_url":"https://api.github.com/repos/pingcap/tidb/issues{/number}","pulls_url":"https://api.github.com/repos/pingcap/tidb/pulls{/number}","milestones_url":"https://api.github.com/repos/pingcap/tidb/milestones{/number}","notifications_url":"https://api.github.com/repos/pingcap/tidb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pingcap/tidb/labels{/name}","releases_url":"https://api.github.com/repos/pingcap/tidb/releases{/id}","deployments_url":"https://api.github.com/repos/pingcap/tidb/deployments","created_at":"2015-09-06T04:01:52Z","updated_at":"2017-09-21T13:42:01Z","pushed_at":"2017-09-21T13:46:49Z","git_url":"git://github.com/pingcap/tidb.git","ssh_url":"git@github.com:pingcap/tidb.git","clone_url":"https://github.com/pingcap/tidb.git","svn_url":"https://github.com/pingcap/tidb","homepage":"https://pingcap.com","size":35343,"stargazers_count":9560,"watchers_count":9560,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1309,"mirror_url":null,"open_issues_count":309,"forks":1309,"open_issues":309,"watchers":9560,"default_branch":"master"}},"base":{"label":"pingcap:master","ref":"master","sha":"b22e639c4a362860293151ae7b60fada4fb6ed16","user":{"login":"pingcap","id":11855343,"avatar_url":"https://avatars3.githubusercontent.com/u/11855343?v=4","gravatar_id":"","url":"https://api.github.com/users/pingcap","html_url":"https://github.com/pingcap","followers_url":"https://api.github.com/users/pingcap/followers","following_url":"https://api.github.com/users/pingcap/following{/other_user}","gists_url":"https://api.github.com/users/pingcap/gists{/gist_id}","starred_url":"https://api.github.com/users/pingcap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingcap/subscriptions","organizations_url":"https://api.github.com/users/pingcap/orgs","repos_url":"https://api.github.com/users/pingcap/repos","events_url":"https://api.github.com/users/pingcap/events{/privacy}","received_events_url":"https://api.github.com/users/pingcap/received_events","type":"Organization","site_admin":false},"repo":{"id":41986369,"name":"tidb","full_name":"pingcap/tidb","owner":{"login":"pingcap","id":11855343,"avatar_url":"https://avatars3.githubusercontent.com/u/11855343?v=4","gravatar_id":"","url":"https://api.github.com/users/pingcap","html_url":"https://github.com/pingcap","followers_url":"https://api.github.com/users/pingcap/followers","following_url":"https://api.github.com/users/pingcap/following{/other_user}","gists_url":"https://api.github.com/users/pingcap/gists{/gist_id}","starred_url":"https://api.github.com/users/pingcap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingcap/subscriptions","organizations_url":"https://api.github.com/users/pingcap/orgs","repos_url":"https://api.github.com/users/pingcap/repos","events_url":"https://api.github.com/users/pingcap/events{/privacy}","received_events_url":"https://api.github.com/users/pingcap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pingcap/tidb","description":"TiDB is a distributed NewSQL database compatible with MySQL protocol ","fork":false,"url":"https://api.github.com/repos/pingcap/tidb","forks_url":"https://api.github.com/repos/pingcap/tidb/forks","keys_url":"https://api.github.com/repos/pingcap/tidb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pingcap/tidb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pingcap/tidb/teams","hooks_url":"https://api.github.com/repos/pingcap/tidb/hooks","issue_events_url":"https://api.github.com/repos/pingcap/tidb/issues/events{/number}","events_url":"https://api.github.com/repos/pingcap/tidb/events","assignees_url":"https://api.github.com/repos/pingcap/tidb/assignees{/user}","branches_url":"https://api.github.com/repos/pingcap/tidb/branches{/branch}","tags_url":"https://api.github.com/repos/pingcap/tidb/tags","blobs_url":"https://api.github.com/repos/pingcap/tidb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pingcap/tidb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pingcap/tidb/git/refs{/sha}","trees_url":"https://api.github.com/repos/pingcap/tidb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pingcap/tidb/statuses/{sha}","languages_url":"https://api.github.com/repos/pingcap/tidb/languages","stargazers_url":"https://api.github.com/repos/pingcap/tidb/stargazers","contributors_url":"https://api.github.com/repos/pingcap/tidb/contributors","subscribers_url":"https://api.github.com/repos/pingcap/tidb/subscribers","subscription_url":"https://api.github.com/repos/pingcap/tidb/subscription","commits_url":"https://api.github.com/repos/pingcap/tidb/commits{/sha}","git_commits_url":"https://api.github.com/repos/pingcap/tidb/git/commits{/sha}","comments_url":"https://api.github.com/repos/pingcap/tidb/comments{/number}","issue_comment_url":"https://api.github.com/repos/pingcap/tidb/issues/comments{/number}","contents_url":"https://api.github.com/repos/pingcap/tidb/contents/{+path}","compare_url":"https://api.github.com/repos/pingcap/tidb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pingcap/tidb/merges","archive_url":"https://api.github.com/repos/pingcap/tidb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pingcap/tidb/downloads","issues_url":"https://api.github.com/repos/pingcap/tidb/issues{/number}","pulls_url":"https://api.github.com/repos/pingcap/tidb/pulls{/number}","milestones_url":"https://api.github.com/repos/pingcap/tidb/milestones{/number}","notifications_url":"https://api.github.com/repos/pingcap/tidb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pingcap/tidb/labels{/name}","releases_url":"https://api.github.com/repos/pingcap/tidb/releases{/id}","deployments_url":"https://api.github.com/repos/pingcap/tidb/deployments","created_at":"2015-09-06T04:01:52Z","updated_at":"2017-09-21T13:42:01Z","pushed_at":"2017-09-21T13:46:49Z","git_url":"git://github.com/pingcap/tidb.git","ssh_url":"git@github.com:pingcap/tidb.git","clone_url":"https://github.com/pingcap/tidb.git","svn_url":"https://github.com/pingcap/tidb","homepage":"https://pingcap.com","size":35343,"stargazers_count":9560,"watchers_count":9560,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1309,"mirror_url":null,"open_issues_count":309,"forks":1309,"open_issues":309,"watchers":9560,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/4579"},"html":{"href":"https://github.com/pingcap/tidb/pull/4579"},"issue":{"href":"https://api.github.com/repos/pingcap/tidb/issues/4579"},"comments":{"href":"https://api.github.com/repos/pingcap/tidb/issues/4579/comments"},"review_comments":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/4579/comments"},"review_comment":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/4579/commits"},"statuses":{"href":"https://api.github.com/repos/pingcap/tidb/statuses/5bd1d04bba83fb9ef1e68d281ea7503d6f00f479"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"coocood"}}