-
Notifications
You must be signed in to change notification settings - Fork 680
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
*: refine placement rule in sql docs (#15231)
- Loading branch information
Showing
8 changed files
with
383 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
title: ALTER RANGE | ||
summary: An overview of the usage of ALTER RANGE for TiDB. | ||
--- | ||
|
||
# ALTER RANGE | ||
|
||
Currently, the `ALTER RANGE` statement can only be used to modify the range of a specific placement policy in TiDB. | ||
|
||
## Synopsis | ||
|
||
```ebnf+diagram | ||
AlterRangeStmt ::= | ||
'ALTER' 'RANGE' Identifier PlacementPolicyOption | ||
``` | ||
|
||
`ALTER RANGE` supports the following two parameters: | ||
|
||
- `global`: indicates the range of all data in a cluster. | ||
- `meta`: indicates the range of internal metadata stored in TiDB. | ||
|
||
## Examples | ||
|
||
```sql | ||
CREATE PLACEMENT POLICY `deploy111` CONSTRAINTS='{"+region=us-east-1":1, "+region=us-east-2": 1, "+region=us-west-1": 1}'; | ||
CREATE PLACEMENT POLICY `five_replicas` FOLLOWERS=4; | ||
|
||
ALTER RANGE global PLACEMENT POLICY = "deploy111"; | ||
ALTER RANGE meta PLACEMENT POLICY = "five_replicas"; | ||
``` | ||
|
||
The preceding example creates two placement policies (`deploy111` and `five_replicas`), specifies constraints for different regions, and then applies the `deploy111` placement policy to all data in the cluster range and the `five_replicas` placement policy to the metadata range. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters