SHOW CREATE PLACEMENT POLICY

SHOW CREATE PLACEMENT POLICY 语句可用于查看放置策略当前的定义,并在另一个 TiDB 集群中重新创建该策略。

语法图

ShowCreatePlacementPolicyStmt
SHOWCREATEPLACEMENTPOLICYPolicyName
PolicyName
Identifier

示例

CREATE PLACEMENT POLICY p1 PRIMARY_REGION="us-east-1" REGIONS="us-east-1,us-west-1" FOLLOWERS=4; CREATE TABLE t1 (a INT) PLACEMENT POLICY=p1; 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" FOLLOWERS=4 1 row in set (0.00 sec)

MySQL 兼容性

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

另请参阅