Skip to content

Commit

Permalink
Add column description for system tables (#3449) (#3456)
Browse files Browse the repository at this point in the history
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
  • Loading branch information
ti-srebot authored Jul 28, 2020
1 parent efc5214 commit a7876df
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 4 deletions.
26 changes: 23 additions & 3 deletions information-schema/information-schema-tikv-region-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ USE information_schema;
DESC tikv_region_status;
```

```
```sql
+---------------------------+-------------+------+------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+-------------+------+------+---------+-------+
Expand All @@ -39,10 +39,30 @@ DESC tikv_region_status;
17 rows in set (0.00 sec)
```

You can implement the `top confver`, `top read` and `top write` operations in pd-ctl via the `ORDER BY X LIMIT Y` operation on the `EPOCH_CONF_VER`, `WRITTEN_BYTES` and `READ_BYTES` columns.
The descriptions of the columns in the `TIKV_REGION_STATUS` table are as follows:

* `REGION_ID`: The ID of the Region.
* `START_KEY`: The value of the start key of the Region.
* `END_KEY`: The value of the end key of the Region.
* `TABLE_ID`: The ID of the table to which the Region belongs.
* `DB_NAME`: The name of the database to which `TABLE_ID` belongs.
* `TABLE_NAME`: The name of the table to which the Region belongs.
* `IS_INDEX`: Whether the Region data is an index. 0 means that it is not an index, while 1 means that it is an index. If the current Region contains both table data and index data, there will be multiple rows of records, and `IS_INDEX` is 0 and 1 respectively.
* `INDEX_ID`: The ID of the index to which the Region belongs. If `IS_INDEX` is 0, the value of this column is NULL.
* `INDEX_NAME`: The name of the index to which the Region belongs. If `IS_INDEX` is 0, the value of this column is NULL.
* `EPOCH_CONF_VER`: The version number of the Region configuration. The version number increases when a peer is added or removed.
* `EPOCH_VERSION`: The current version number of the Region. The version number increases when the Region is split or merged.
* `WRITTEN_BYTES`: The amount of data (bytes) written to the Region.
* `READ_BYTES`: The amount of data (bytes) that has been read from the Region.
* `APPROXIMATE_SIZE`: The approximate data size (MB) of the Region.
* `APPROXIMATE_KEYS`: The approximate number of keys in the Region.
* `REPLICATIONSTATUS_STATE`: The current replication status of the Region. The status might be `UNKNOWN`, `SIMPLE_MAJORITY`, or `INTEGRITY_OVER_LABEL`.
* `REPLICATIONSTATUS_STATEID`: The identifier corresponding to `REPLICATIONSTATUS_STATE`.

Also, you can implement the `top confver`, `top read` and `top write` operations in pd-ctl via the `ORDER BY X LIMIT Y` operation on the `EPOCH_CONF_VER`, `WRITTEN_BYTES` and `READ_BYTES` columns.

You can query the top 3 Regions with the most write data using the following SQL statement:

```sql
SELECT * FROM tikv_region_status ORDER BY written_bytes DESC LIMIT 3;
```
```
24 changes: 23 additions & 1 deletion information-schema/information-schema-tikv-store-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ USE information_schema;
DESC tikv_store_status;
```

```
```sql
+-------------------+-------------+------+------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------------+-------------+------+------+---------+-------+
Expand All @@ -40,3 +40,25 @@ DESC tikv_store_status;
+-------------------+-------------+------+------+---------+-------+
19 rows in set (0.00 sec)
```

The descriptions of the columns in the `TIKV_STORE_STATUS` table are as follows:

* `STORE_ID`: The ID of the Store.
* `ADDRESS`: The address of the Store.
* `STORE_STATE`: The identifier of the Store state, which corresponds to `STORE_STATE_NAME`.
* `STORE_STATE_NAME`: The name of the Store state. The name is `Up`, `Offline`, or `Tombstone`.
* `LABEL`: The label set for the Store.
* `VERSION`: The version number of the Store.
* `CAPACITY`: The storage capacity of the Store.
* `AVAILABLE`: The remaining storage space of the Store.
* `LEADER_COUNT`: The number of leaders on the Store.
* `LEADER_WEIGHT`: The leader weight of the Store.
* `LEADER_SCORE`: The leader score of the Store.
* `LEADER_SIZE`: The approximate total data size (MB) of all leaders on the Store.
* `REGION_COUNT`: The number of Regions on the Store.
* `REGION_WEIGHT`: The Region weight of the Store.
* `REGION_SCORE`: The Region score of the Store.
* `REGION_SIZE`: The approximate total data size (MB) of all Regions on the Store.
* `START_TS`: The timestamp when the Store is started.
* `LAST_HEARTBEAT_TS`: The timestamp of the last heartbeat sent by the Store.
* `UPTIME`: The total time since the Store starts.

0 comments on commit a7876df

Please sign in to comment.