{"action":"created","comment":{"url":"https://api.github.com/repos/pingcap/docs-cn/pulls/comments/231790549","pull_request_review_id":172836319,"id":231790549,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMTc5MDU0OQ==","diff_hunk":"@@ -109,6 +109,28 @@ TiDB 使用乐观事务模型，在执行 Update、Insert、Delete 等语句时\n * 键值对的总数不超过 300,000\n * 键值对的总大小不超过 100MB\n \n+### 小事务\n+\n+由于 TiDB 中的每个事务都需要跟 PD leader 建立两个 round trip，TiDB 中的小事务相比于 MySQL 中的小事务延迟更高。以如下的 query 为例，除去 `auto_commit`，使用更明确的事务，可优化该 query 的性能。","path":"sql/mysql-compatibility.md","position":6,"original_position":6,"commit_id":"62df417e8500e6f79e67dc2087620b672e1d4651","original_commit_id":"62df417e8500e6f79e67dc2087620b672e1d4651","user":{"login":"kennytm","id":103023,"node_id":"MDQ6VXNlcjEwMzAyMw==","avatar_url":"https://avatars1.githubusercontent.com/u/103023?v=4","gravatar_id":"","url":"https://api.github.com/users/kennytm","html_url":"https://github.com/kennytm","followers_url":"https://api.github.com/users/kennytm/followers","following_url":"https://api.github.com/users/kennytm/following{/other_user}","gists_url":"https://api.github.com/users/kennytm/gists{/gist_id}","starred_url":"https://api.github.com/users/kennytm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kennytm/subscriptions","organizations_url":"https://api.github.com/users/kennytm/orgs","repos_url":"https://api.github.com/users/kennytm/repos","events_url":"https://api.github.com/users/kennytm/events{/privacy}","received_events_url":"https://api.github.com/users/kennytm/received_events","type":"User","site_admin":false},"body":"```suggestion\r\n由于 TiDB 中的每个事务都需要跟 PD leader 进行两次 round trip，TiDB 中的小事务相比于 MySQL 中的小事务延迟更高。以如下的 query 为例，除去 `auto_commit`，使用更明确的事务，可优化该 query 的性能。\r\n```","created_at":"2018-11-08T07:56:34Z","updated_at":"2018-11-08T07:57:02Z","html_url":"https://github.com/pingcap/docs-cn/pull/977#discussion_r231790549","pull_request_url":"https://api.github.com/repos/pingcap/docs-cn/pulls/977","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/pingcap/docs-cn/pulls/comments/231790549"},"html":{"href":"https://github.com/pingcap/docs-cn/pull/977#discussion_r231790549"},"pull_request":{"href":"https://api.github.com/repos/pingcap/docs-cn/pulls/977"}}},"pull_request":{"url":"https://api.github.com/repos/pingcap/docs-cn/pulls/977","id":229269640,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI5MjY5NjQw","html_url":"https://github.com/pingcap/docs-cn/pull/977","diff_url":"https://github.com/pingcap/docs-cn/pull/977.diff","patch_url":"https://github.com/pingcap/docs-cn/pull/977.patch","issue_url":"https://api.github.com/repos/pingcap/docs-cn/issues/977","number":977,"state":"open","locked":false,"title":"sql: add the description of small transactions","user":{"login":"CaitinChen","id":34535727,"node_id":"MDQ6VXNlcjM0NTM1NzI3","avatar_url":"https://avatars2.githubusercontent.com/u/34535727?v=4","gravatar_id":"","url":"https://api.github.com/users/CaitinChen","html_url":"https://github.com/CaitinChen","followers_url":"https://api.github.com/users/CaitinChen/followers","following_url":"https://api.github.com/users/CaitinChen/following{/other_user}","gists_url":"https://api.github.com/users/CaitinChen/gists{/gist_id}","starred_url":"https://api.github.com/users/CaitinChen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CaitinChen/subscriptions","organizations_url":"https://api.github.com/users/CaitinChen/orgs","repos_url":"https://api.github.com/users/CaitinChen/repos","events_url":"https://api.github.com/users/CaitinChen/events{/privacy}","received_events_url":"https://api.github.com/users/CaitinChen/received_events","type":"User","site_admin":false},"body":"via https://github.com/pingcap/docs/pull/714\r\n@lilin90 @kennytm PTAL","created_at":"2018-11-08T07:12:36Z","updated_at":"2018-11-08T07:57:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fc5868545091f4a0c8cc8ccdb883bc9831f3176f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/pingcap/docs-cn/pulls/977/commits","review_comments_url":"https://api.github.com/repos/pingcap/docs-cn/pulls/977/comments","review_comment_url":"https://api.github.com/repos/pingcap/docs-cn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pingcap/docs-cn/issues/977/comments","statuses_url":"https://api.github.com/repos/pingcap/docs-cn/statuses/62df417e8500e6f79e67dc2087620b672e1d4651","head":{"label":"CaitinChen:add-small-transaction","ref":"add-small-transaction","sha":"62df417e8500e6f79e67dc2087620b672e1d4651","user":{"login":"CaitinChen","id":34535727,"node_id":"MDQ6VXNlcjM0NTM1NzI3","avatar_url":"https://avatars2.githubusercontent.com/u/34535727?v=4","gravatar_id":"","url":"https://api.github.com/users/CaitinChen","html_url":"https://github.com/CaitinChen","followers_url":"https://api.github.com/users/CaitinChen/followers","following_url":"https://api.github.com/users/CaitinChen/following{/other_user}","gists_url":"https://api.github.com/users/CaitinChen/gists{/gist_id}","starred_url":"https://api.github.com/users/CaitinChen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CaitinChen/subscriptions","organizations_url":"https://api.github.com/users/CaitinChen/orgs","repos_url":"https://api.github.com/users/CaitinChen/repos","events_url":"https://api.github.com/users/CaitinChen/events{/privacy}","received_events_url":"https://api.github.com/users/CaitinChen/received_events","type":"User","site_admin":false},"repo":{"id":118429762,"node_id":"MDEwOlJlcG9zaXRvcnkxMTg0Mjk3NjI=","name":"docs-cn","full_name":"CaitinChen/docs-cn","private":false,"owner":{"login":"CaitinChen","id":34535727,"node_id":"MDQ6VXNlcjM0NTM1NzI3","avatar_url":"https://avatars2.githubusercontent.com/u/34535727?v=4","gravatar_id":"","url":"https://api.github.com/users/CaitinChen","html_url":"https://github.com/CaitinChen","followers_url":"https://api.github.com/users/CaitinChen/followers","following_url":"https://api.github.com/users/CaitinChen/following{/other_user}","gists_url":"https://api.github.com/users/CaitinChen/gists{/gist_id}","starred_url":"https://api.github.com/users/CaitinChen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CaitinChen/subscriptions","organizations_url":"https://api.github.com/users/CaitinChen/orgs","repos_url":"https://api.github.com/users/CaitinChen/repos","events_url":"https://api.github.com/users/CaitinChen/events{/privacy}","received_events_url":"https://api.github.com/users/CaitinChen/received_events","type":"User","site_admin":false},"html_url":"https://github.com/CaitinChen/docs-cn","description":"TiDB/TiKV/PD documents in Chinese.","fork":true,"url":"https://api.github.com/repos/CaitinChen/docs-cn","forks_url":"https://api.github.com/repos/CaitinChen/docs-cn/forks","keys_url":"https://api.github.com/repos/CaitinChen/docs-cn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CaitinChen/docs-cn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CaitinChen/docs-cn/teams","hooks_url":"https://api.github.com/repos/CaitinChen/docs-cn/hooks","issue_events_url":"https://api.github.com/repos/CaitinChen/docs-cn/issues/events{/number}","events_url":"https://api.github.com/repos/CaitinChen/docs-cn/events","assignees_url":"https://api.github.com/repos/CaitinChen/docs-cn/assignees{/user}","branches_url":"https://api.github.com/repos/CaitinChen/docs-cn/branches{/branch}","tags_url":"https://api.github.com/repos/CaitinChen/docs-cn/tags","blobs_url":"https://api.github.com/repos/CaitinChen/docs-cn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CaitinChen/docs-cn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CaitinChen/docs-cn/git/refs{/sha}","trees_url":"https://api.github.com/repos/CaitinChen/docs-cn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CaitinChen/docs-cn/statuses/{sha}","languages_url":"https://api.github.com/repos/CaitinChen/docs-cn/languages","stargazers_url":"https://api.github.com/repos/CaitinChen/docs-cn/stargazers","contributors_url":"https://api.github.com/repos/CaitinChen/docs-cn/contributors","subscribers_url":"https://api.github.com/repos/CaitinChen/docs-cn/subscribers","subscription_url":"https://api.github.com/repos/CaitinChen/docs-cn/subscription","commits_url":"https://api.github.com/repos/CaitinChen/docs-cn/commits{/sha}","git_commits_url":"https://api.github.com/repos/CaitinChen/docs-cn/git/commits{/sha}","comments_url":"https://api.github.com/repos/CaitinChen/docs-cn/comments{/number}","issue_comment_url":"https://api.github.com/repos/CaitinChen/docs-cn/issues/comments{/number}","contents_url":"https://api.github.com/repos/CaitinChen/docs-cn/contents/{+path}","compare_url":"https://api.github.com/repos/CaitinChen/docs-cn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CaitinChen/docs-cn/merges","archive_url":"https://api.github.com/repos/CaitinChen/docs-cn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CaitinChen/docs-cn/downloads","issues_url":"https://api.github.com/repos/CaitinChen/docs-cn/issues{/number}","pulls_url":"https://api.github.com/repos/CaitinChen/docs-cn/pulls{/number}","milestones_url":"https://api.github.com/repos/CaitinChen/docs-cn/milestones{/number}","notifications_url":"https://api.github.com/repos/CaitinChen/docs-cn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CaitinChen/docs-cn/labels{/name}","releases_url":"https://api.github.com/repos/CaitinChen/docs-cn/releases{/id}","deployments_url":"https://api.github.com/repos/CaitinChen/docs-cn/deployments","created_at":"2018-01-22T08:41:52Z","updated_at":"2018-11-06T03:50:22Z","pushed_at":"2018-11-08T07:19:48Z","git_url":"git://github.com/CaitinChen/docs-cn.git","ssh_url":"git@github.com:CaitinChen/docs-cn.git","clone_url":"https://github.com/CaitinChen/docs-cn.git","svn_url":"https://github.com/CaitinChen/docs-cn","homepage":"https://pingcap.github.io/docs-cn","size":8926,"stargazers_count":0,"watchers_count":0,"language":"TeX","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pingcap:master","ref":"master","sha":"7d107d20afe63b09542b804e01624208192563e9","user":{"login":"pingcap","id":11855343,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExODU1MzQz","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":64188788,"node_id":"MDEwOlJlcG9zaXRvcnk2NDE4ODc4OA==","name":"docs-cn","full_name":"pingcap/docs-cn","private":false,"owner":{"login":"pingcap","id":11855343,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExODU1MzQz","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},"html_url":"https://github.com/pingcap/docs-cn","description":"TiDB/TiKV/PD documents in Chinese.","fork":false,"url":"https://api.github.com/repos/pingcap/docs-cn","forks_url":"https://api.github.com/repos/pingcap/docs-cn/forks","keys_url":"https://api.github.com/repos/pingcap/docs-cn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pingcap/docs-cn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pingcap/docs-cn/teams","hooks_url":"https://api.github.com/repos/pingcap/docs-cn/hooks","issue_events_url":"https://api.github.com/repos/pingcap/docs-cn/issues/events{/number}","events_url":"https://api.github.com/repos/pingcap/docs-cn/events","assignees_url":"https://api.github.com/repos/pingcap/docs-cn/assignees{/user}","branches_url":"https://api.github.com/repos/pingcap/docs-cn/branches{/branch}","tags_url":"https://api.github.com/repos/pingcap/docs-cn/tags","blobs_url":"https://api.github.com/repos/pingcap/docs-cn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pingcap/docs-cn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pingcap/docs-cn/git/refs{/sha}","trees_url":"https://api.github.com/repos/pingcap/docs-cn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pingcap/docs-cn/statuses/{sha}","languages_url":"https://api.github.com/repos/pingcap/docs-cn/languages","stargazers_url":"https://api.github.com/repos/pingcap/docs-cn/stargazers","contributors_url":"https://api.github.com/repos/pingcap/docs-cn/contributors","subscribers_url":"https://api.github.com/repos/pingcap/docs-cn/subscribers","subscription_url":"https://api.github.com/repos/pingcap/docs-cn/subscription","commits_url":"https://api.github.com/repos/pingcap/docs-cn/commits{/sha}","git_commits_url":"https://api.github.com/repos/pingcap/docs-cn/git/commits{/sha}","comments_url":"https://api.github.com/repos/pingcap/docs-cn/comments{/number}","issue_comment_url":"https://api.github.com/repos/pingcap/docs-cn/issues/comments{/number}","contents_url":"https://api.github.com/repos/pingcap/docs-cn/contents/{+path}","compare_url":"https://api.github.com/repos/pingcap/docs-cn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pingcap/docs-cn/merges","archive_url":"https://api.github.com/repos/pingcap/docs-cn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pingcap/docs-cn/downloads","issues_url":"https://api.github.com/repos/pingcap/docs-cn/issues{/number}","pulls_url":"https://api.github.com/repos/pingcap/docs-cn/pulls{/number}","milestones_url":"https://api.github.com/repos/pingcap/docs-cn/milestones{/number}","notifications_url":"https://api.github.com/repos/pingcap/docs-cn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pingcap/docs-cn/labels{/name}","releases_url":"https://api.github.com/repos/pingcap/docs-cn/releases{/id}","deployments_url":"https://api.github.com/repos/pingcap/docs-cn/deployments","created_at":"2016-07-26T04:04:37Z","updated_at":"2018-11-08T07:20:33Z","pushed_at":"2018-11-08T07:20:30Z","git_url":"git://github.com/pingcap/docs-cn.git","ssh_url":"git@github.com:pingcap/docs-cn.git","clone_url":"https://github.com/pingcap/docs-cn.git","svn_url":"https://github.com/pingcap/docs-cn","homepage":"https://pingcap.github.io/docs-cn","size":8875,"stargazers_count":1045,"watchers_count":1045,"language":"TeX","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":356,"mirror_url":null,"archived":false,"open_issues_count":73,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":356,"open_issues":73,"watchers":1045,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pingcap/docs-cn/pulls/977"},"html":{"href":"https://github.com/pingcap/docs-cn/pull/977"},"issue":{"href":"https://api.github.com/repos/pingcap/docs-cn/issues/977"},"comments":{"href":"https://api.github.com/repos/pingcap/docs-cn/issues/977/comments"},"review_comments":{"href":"https://api.github.com/repos/pingcap/docs-cn/pulls/977/comments"},"review_comment":{"href":"https://api.github.com/repos/pingcap/docs-cn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pingcap/docs-cn/pulls/977/commits"},"statuses":{"href":"https://api.github.com/repos/pingcap/docs-cn/statuses/62df417e8500e6f79e67dc2087620b672e1d4651"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"kennytm"}}