-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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 split table syntax to split table region #10553
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10553 +/- ##
================================================
- Coverage 79.6029% 79.5794% -0.0236%
================================================
Files 415 415
Lines 88101 88254 +153
================================================
+ Hits 70131 70232 +101
- Misses 12784 12828 +44
- Partials 5186 5194 +8 |
/run-all-tests |
Co-Authored-By: bb7133 <[email protected]>
Co-Authored-By: bb7133 <[email protected]>
Co-Authored-By: bb7133 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
However, we should take care of the English syntax in self-made error messages. Different from code variables/comments, error messages are sent and shown to end-users. I advise making another PR to fix typos/misspellings in this PR and #10409, for example: https://github.com/pingcap/tidb/pull/10553/files#diff-ce300a40f7a5a1103912bc56991b9cb8R1794 |
/run-all-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/run-all-tests |
executor/split.go
Outdated
continue | ||
} | ||
regionIDs = append(regionIDs, regionID) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this useless line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What problem does this PR solve?
Please merge :#10409 first.
Add new syntax for
split table region
.SPLIT TABLE [table_name] BETWEEN (min_value...) AND (max_value...) REGIONS [region_num] SPLIT TABLE [table_name] BY [value_lists]
Attention
min
andmax
value count should be 1.1000
in a single query.Eg1
Upper sql will split
5
regions of the tablet
in range0~1000
. Every region range like below:Region1: -inf ~ 200
Region2: 200 ~ 400
Region3: 400 ~ 600
Region4: 600 ~ 800
Region5: 800 ~ +inf
Eg2
Upper sql will split
4
regions of the tablet
, Every region range like below:Region1: -inf ~ 100
Region2: 100 ~ 200
Region3: 200 ~ 300
Region4: 300 ~ +inf
What is changed and how it works?
Check List
Tests
Code changes
Side effects
Related changes