Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add content about lazy uniqueness check #11166

Merged
merged 28 commits into from
Sep 19, 2022

Conversation

ekexium
Copy link
Contributor

@ekexium ekexium commented Sep 1, 2022

Signed-off-by: ekexium eke@fastmail.com

First-time contributors' checklist

What is changed, added or deleted? (Required)

Add content about the new feature lazy uniqueness check.

Which TiDB version(s) do your changes apply to? (Required)

Tips for choosing the affected version(s):

By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.

For details, see tips for choosing the affected versions (in Chinese).

  • master (the latest development version)
  • v6.3 (TiDB 6.3 versions)
  • v6.1 (TiDB 6.1 versions)
  • v5.4 (TiDB 5.4 versions)
  • v5.3 (TiDB 5.3 versions)
  • v5.2 (TiDB 5.2 versions)
  • v5.1 (TiDB 5.1 versions)
  • v5.0 (TiDB 5.0 versions)

What is the related PR or file link(s)?

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Sep 1, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • hfxsd

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added missing-translation-status This PR does not have translation status info. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 1, 2022
@shichun-0415 shichun-0415 added translation/doing This PR’s assignee is translating this PR. v6.3 This PR/issue applies to TiDB v6.3. and removed missing-translation-status This PR does not have translation status info. labels Sep 1, 2022
@shichun-0415 shichun-0415 requested review from qiancai and removed request for TomShawn September 1, 2022 07:37
@ekexium ekexium force-pushed the lazy-uniqueness-check branch 2 times, most recently from 736085d to 0642b6c Compare September 1, 2022 08:46
Signed-off-by: ekexium <eke@fastmail.com>
constraints.md Outdated Show resolved Hide resolved
@ekexium ekexium force-pushed the lazy-uniqueness-check branch 2 times, most recently from b93059c to ce85c29 Compare September 2, 2022 06:29
Signed-off-by: ekexium <eke@fastmail.com>
constraints.md Outdated Show resolved Hide resolved
system-variables.md Outdated Show resolved Hide resolved
system-variables.md Outdated Show resolved Hide resolved
system-variables.md Outdated Show resolved Hide resolved
error-codes.md Outdated Show resolved Hide resolved
constraints.md Outdated Show resolved Hide resolved
constraints.md Outdated Show resolved Hide resolved
constraints.md Outdated Show resolved Hide resolved
constraints.md Outdated Show resolved Hide resolved
constraints.md Outdated Show resolved Hide resolved
constraints.md Outdated Show resolved Hide resolved
Co-authored-by: Grace Cai <qqzczy@126.com>
@shichun-0415 shichun-0415 added the type/compatibility-or-feature-change This PR involves compatibility changes or feature behavior changes. label Sep 7, 2022
Signed-off-by: ekexium <eke@fastmail.com>
Signed-off-by: ekexium <eke@fastmail.com>
error-codes.md Outdated Show resolved Hide resolved
constraints.md Outdated Show resolved Hide resolved
constraints.md Outdated Show resolved Hide resolved
error-codes.md Outdated Show resolved Hide resolved
error-codes.md Outdated Show resolved Hide resolved
pessimistic-transaction.md Outdated Show resolved Hide resolved
system-variables.md Outdated Show resolved Hide resolved
system-variables.md Show resolved Hide resolved
system-variables.md Outdated Show resolved Hide resolved
Signed-off-by: ekexium <eke@fastmail.com>
ekexium and others added 3 commits September 16, 2022 12:14
Co-authored-by: Grace Cai <qqzczy@126.com>
Co-authored-by: xixirangrang <hfxsd@hotmail.com>
Signed-off-by: ekexium <eke@fastmail.com>
Co-authored-by: xixirangrang <hfxsd@hotmail.com>
constraints.md Outdated
ERROR 1062 (23000): Duplicate entry 'bill' for key 'username'
```

对于悲观事务,你可以设置变量 [`tidb_constraint_check_in_place_pessimistic`](/system-variables.md#tidb_constraint_check_in_place_pessimistic-从-v630-版本开始引入) 为 `0` 来推迟唯一约束检查,到下一次对该唯一索引项加锁时或事务提交时再进行检查,同时也跳过对该悲观锁加锁,以获得更好的性能。此时需要注意:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“以获得更好的性能” 建议改成 “在批量操作时获得更好的性能”

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不批量也有改进,感觉没啥影响。

@songrijie
Copy link
Contributor

rest LGTM

Signed-off-by: ekexium <eke@fastmail.com>
Copy link
Collaborator

@hfxsd hfxsd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 16, 2022
Signed-off-by: ekexium <eke@fastmail.com>
constraints.md Outdated Show resolved Hide resolved
constraints.md Outdated Show resolved Hide resolved
constraints.md Outdated Show resolved Hide resolved
constraints.md Outdated Show resolved Hide resolved
constraints.md Outdated Show resolved Hide resolved
error-codes.md Outdated Show resolved Hide resolved
system-variables.md Outdated Show resolved Hide resolved
system-variables.md Outdated Show resolved Hide resolved
system-variables.md Outdated Show resolved Hide resolved
@qiancai
Copy link
Collaborator

qiancai commented Sep 19, 2022

/remove-status LGT1
/status LGT2

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Sep 19, 2022
@qiancai
Copy link
Collaborator

qiancai commented Sep 19, 2022

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 5815435

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 19, 2022
@ti-chi-bot ti-chi-bot merged commit 7b11ffa into pingcap:master Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/transaction Indicates that the Issue or PR belongs to the area of transaction. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. type/compatibility-or-feature-change This PR involves compatibility changes or feature behavior changes. v6.3 This PR/issue applies to TiDB v6.3.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants