ALTER RANGE

Currently, the ALTER RANGE statement can only be used to modify the range of a specific placement policy in TiDB.

ALTER RANGE - 图1

Note

This feature is not available on TiDB Serverless clusters.

Synopsis

AlterRangeStmt

ALTER RANGE - 图2

  1. AlterRangeStmt ::=
  2. '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

  1. CREATE PLACEMENT POLICY `deploy111` CONSTRAINTS='{"+region=us-east-1":1, "+region=us-east-2": 1, "+region=us-west-1": 1}';
  2. CREATE PLACEMENT POLICY `five_replicas` FOLLOWERS=4;
  3. ALTER RANGE global PLACEMENT POLICY = "deploy111";
  4. 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.