SHOW PLACEMENT

SHOW PLACEMENT summarizes all placement options from placement policies, and presents them in canonical form.

SHOW PLACEMENT - 图1

Note

This feature is not available on TiDB Serverless clusters.

The statement returns a result set in which the Scheduling_State field indicates the current progress that the Placement Driver (PD) has made in scheduling the placement:

  • PENDING: The PD has not yet started scheduling the placement. This might indicate that that the placement rules are semantically correct, but cannot currently be satisfied by the cluster. For example, if FOLLOWERS=4 but there are only 3 TiKV stores which are candidates for followers.
  • INPROGRESS: The PD is currently scheduling the placement.
  • SCHEDULED: The PD has successfully scheduled the placement.

Synopsis

ShowStmt

SHOW PLACEMENT - 图2

  1. ShowStmt ::=
  2. "PLACEMENT"

Examples

  1. CREATE PLACEMENT POLICY p1 PRIMARY_REGION="us-east-1" REGIONS="us-east-1,us-west-1" FOLLOWERS=4;
  2. CREATE TABLE t1 (a INT) PLACEMENT POLICY=p1;
  3. SHOW PLACEMENT;
  1. Query OK, 0 rows affected (0.01 sec)
  2. Query OK, 0 rows affected (0.00 sec)
  3. +---------------+----------------------------------------------------------------------+------------------+
  4. | Target | Placement | Scheduling_State |
  5. +---------------+----------------------------------------------------------------------+------------------+
  6. | POLICY p1 | PRIMARY_REGION="us-east-1" REGIONS="us-east-1,us-west-1" FOLLOWERS=4 | NULL |
  7. | DATABASE test | PRIMARY_REGION="us-east-1" REGIONS="us-east-1,us-west-1" FOLLOWERS=4 | INPROGRESS |
  8. | TABLE test.t1 | PRIMARY_REGION="us-east-1" REGIONS="us-east-1,us-west-1" FOLLOWERS=4 | INPROGRESS |
  9. +---------------+----------------------------------------------------------------------+------------------+
  10. 4 rows in set (0.00 sec)

MySQL compatibility

This statement is a TiDB extension to MySQL syntax.

See also