Skip to content

Commit

Permalink
reference/system-databases: add description for `TIDB_ROW_ID_SHARDING…
Browse files Browse the repository at this point in the history
…_INFO`
  • Loading branch information
bb7133 committed Feb 12, 2020
1 parent 1fa7d90 commit d08dab8
Showing 1 changed file with 32 additions and 22 deletions.
54 changes: 32 additions & 22 deletions dev/reference/system-databases/information-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -434,28 +434,29 @@ SELECT * FROM tables WHERE table_schema='mysql' AND table_name='user';

```
*************************** 1. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: mysql
TABLE_NAME: user
TABLE_TYPE: BASE TABLE
ENGINE: InnoDB
VERSION: 10
ROW_FORMAT: Compact
TABLE_ROWS: 0
AVG_ROW_LENGTH: 0
DATA_LENGTH: 0
MAX_DATA_LENGTH: 0
INDEX_LENGTH: 0
DATA_FREE: 0
AUTO_INCREMENT: 0
CREATE_TIME: 2019-03-29 09:17:27
UPDATE_TIME: NULL
CHECK_TIME: NULL
TABLE_COLLATION: utf8mb4_bin
CHECKSUM: NULL
CREATE_OPTIONS:
TABLE_COMMENT:
TIDB_TABLE_ID: 5
TABLE_CATALOG: def
TABLE_SCHEMA: mysql
TABLE_NAME: user
TABLE_TYPE: BASE TABLE
ENGINE: InnoDB
VERSION: 10
ROW_FORMAT: Compact
TABLE_ROWS: 0
AVG_ROW_LENGTH: 0
DATA_LENGTH: 0
MAX_DATA_LENGTH: 0
INDEX_LENGTH: 0
DATA_FREE: 0
AUTO_INCREMENT: 0
CREATE_TIME: 2019-03-29 09:17:27
UPDATE_TIME: NULL
CHECK_TIME: NULL
TABLE_COLLATION: utf8mb4_bin
CHECKSUM: NULL
CREATE_OPTIONS:
TABLE_COMMENT:
TIDB_TABLE_ID: 5
TIDB_ROW_ID_SHARDING_INFO: NULL
1 row in set (0.00 sec)
```

Expand All @@ -477,6 +478,15 @@ SHOW TABLES
[LIKE 'wild']
```

表中的信息大部分定义自 MySQL,此外有两列是 TiDB 新增的:

* `TiDB_TABLE_ID`:标识表的内部 ID,该 ID 在一个 TiDB 集群内部唯一。
* `TIDB_ROW_ID_SHARDING_INFO`:标识表的 Sharding 类型,可能的值为:
- `"NOT_SHARDED"`:表未被 Shard。
- `"NOT_SHARDED(PK_IS_HANDLE)"`:一个定义了整型主键的表未被 Shard。
- `"PK_AUTO_RANDOM_BITS={bit_number}"`:一个定义了整型主键的表由于定义了 `AUTO_RANDOM` 而被 Shard。
- `"SHARD_BITS={bit_number}"`:表使用 `SHARD_ROW_ID_BITS={bit_number}` 进行了 Shard。

## TABLE_CONSTRAINTS 表

`TABLE_CONSTRAINTS` 表记录了表的约束信息。
Expand Down

0 comments on commit d08dab8

Please sign in to comment.