ALTER PLACEMENT POLICY

ALTER PLACEMENT POLICY 用于修改已创建的放置策略。此修改会自动更新至所有使用这些放置策略的表和分区。

语法图

AlterPolicyStmt
ALTERPLACEMENTPOLICYIfExistsPolicyNamePlacementOptionList
PolicyName
Identifier
PlacementOptionList
DirectPlacementOptionPlacementOptionListDirectPlacementOptionPlacementOptionList,DirectPlacementOption
DirectPlacementOption
PRIMARY_REGIONEqOptstringLitREGIONSEqOptstringLitFOLLOWERSEqOptLengthNumVOTERSEqOptLengthNumLEARNERSEqOptLengthNumSCHEDULEEqOptstringLitCONSTRAINTSEqOptstringLitLEADER_CONSTRAINTSEqOptstringLitFOLLOWER_CONSTRAINTSEqOptstringLitVOTER_CONSTRAINTSEqOptstringLitLEARNER_CONSTRAINTSEqOptstringLit

示例

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 兼容性

该语句是 TiDB 对 MySQL 语法的扩展。

另请参阅

文档内容是否有帮助?