ALTER PLACEMENT POLICY
ALTER PLACEMENT POLICY
is used to modify existing placement policies that have previously been created. All the tables and partitions which use the placement policy will automatically be updated.
Synopsis
- AlterPolicyStmt
- PolicyName
- PlacementOptionList
- DirectPlacementOption
AlterPolicyStmt ::=
"ALTER" "PLACEMENT" "POLICY" IfExists PolicyName PlacementOptionList
PolicyName ::=
Identifier
PlacementOptionList ::=
DirectPlacementOption
| PlacementOptionList DirectPlacementOption
| PlacementOptionList ',' DirectPlacementOption
DirectPlacementOption ::=
"PRIMARY_REGION" EqOpt stringLit
| "REGIONS" EqOpt stringLit
| "FOLLOWERS" EqOpt LengthNum
| "VOTERS" EqOpt LengthNum
| "LEARNERS" EqOpt LengthNum
| "SCHEDULE" EqOpt stringLit
| "CONSTRAINTS" EqOpt stringLit
| "LEADER_CONSTRAINTS" EqOpt stringLit
| "FOLLOWER_CONSTRAINTS" EqOpt stringLit
| "VOTER_CONSTRAINTS" EqOpt stringLit
| "LEARNER_CONSTRAINTS" EqOpt stringLit
Examples
CREATE PLACEMENT POLICY p1 PRIMARY_REGION="us-east-1" REGIONS="us-east-1,us-west-1";
ALTER PLACEMENT POLICY p1 PRIMARY_REGION="us-east-1" REGIONS="us-east-1,us-west-1,us-west-2" FOLLOWERS=4;
SHOW CREATE PLACEMENT POLICY p1\G
Query OK, 0 rows affected (0.08 sec)
Query OK, 0 rows affected (0.10 sec)
*************************** 1. row ***************************
Policy: p1
Create Policy: CREATE PLACEMENT POLICY `p1` PRIMARY_REGION="us-east-1" REGIONS="us-east-1,us-west-1,us-west-2" FOLLOWERS=4
1 row in set (0.00 sec)
MySQL compatibility
This statement is a TiDB extension to MySQL syntax.