Skip to content

Commit

Permalink
docs(4paradigm#1801): show components & show table status
Browse files Browse the repository at this point in the history
  • Loading branch information
aceforeverd committed Jun 9, 2022
1 parent 482a37d commit 866f3f3
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 0 deletions.
42 changes: 42 additions & 0 deletions docs/zh/reference/sql/ddl/SHOW_COMPONENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# SHOW COMPONENTS

```sql
SHOW COMPONENTS
```

显示当前 OpenMLDB 系统的各个组件信息,包括 tablet, nameserver, task manager 和 api server。



Column Informations

| Column | Description |
| ------------ | ------------------------------------------------------------ |
| Endpoint | component endpoint, same as `--endpoint` flag in openmldb |
| Role | 组件角色。有 `tablet`,`nameserver`,`taskmanager`,`apiserver`, 同 `--role`flag in openmldb |
| Connect_time | 组件连接时间,以毫秒时间戳形式展示 |
| Status | 组件状态, `online`, `offline`or `NULL` |
| Ns_role | Namserver 的角色,`master`or `standby` |

注意:`SHOW COMPONETS` 目前仍有部分未完善的功能:

- 不能展示 api server 信息
- 只能展示单个 task manager master 的信息,不能展示其他 slave 节点
- standalone 模式下 name server 的 connect time 不准确

# Example

```sql
> SHOW COMPONENTS;
---------------- ------------ --------------- -------- ---------
Endpoint Role Connect_time Status Ns_role
---------------- ------------ --------------- -------- ---------
127.0.0.1:9520 tablet 1654759517890 online NULL
127.0.0.1:9521 tablet 1654759517942 online NULL
127.0.0.1:9522 tablet 1654759517919 online NULL
127.0.0.1:9622 nameserver 1654759519015 online master
127.0.0.1:9623 nameserver 1654759521016 online standby
127.0.0.1:9624 nameserver 1654759523030 online standby
---------------- ------------ --------------- -------- ---------
```

2 changes: 2 additions & 0 deletions docs/zh/reference/sql/ddl/SHOW_TABLES_STATEMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ SHOW TABLES;

[USE DATABASE](../ddl/USE_DATABASE_STATEMENT.md)

[SHOW TABLE STATUS](../ddl/SHOW_TABLE_STATUS.md)

42 changes: 42 additions & 0 deletions docs/zh/reference/sql/ddl/SHOW_TABLE_STATUS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# SHOW TABLE STATUS

```sql
SHOW TABLE STATUS
```

展示当前使用的数据库或者所有数据库下 tables 的详细信息。如果未使用任何 database, `SHOW TABLE STATUS`展示所有数据库里 tables 的信息,不包括隐藏数据库;如果使用了特定 database, 只展示当前数据库下 tables 的信息。



Column Information

| Column | Description |
| ----------------- | ---------------------------------------------------------- |
| Table_id | 表唯一 id |
| Table_name | 表名 |
| Database_name | 数据库名 |
| Storage_type | 存储类型, `memory`,`ssd`,`hdd` |
| Rows | 表的 rows count |
| Memory_data_size | 表内存占用(单位 bytes) |
| Disk_data_size | 表磁盘占用 (但我 bytes) |
| Partition | Partiton 数量 |
| Partition_unalive | Unalive partition 数量 |
| Replica | Replica 数量 |
| Offline_path | 表对应 offline 数据路径, `NULL` if not exists |
| Offline_format | 表对应 offline 数据格式, `NULL` if not exists |
| Offline_deep_copy | 表对应 offline 数据是否使用 deep copy, `NULL` if not exits |



# Example

```sql
> USE db;
> SHOW TABLE STATUS;
---------- ------------ --------------- -------------- ------ ------------------ ---------------- ----------- ------------------- --------- -------------- ---------------- -------------------
Table_id Table_name Database_name Storage_type Rows Memory_data_size Disk_data_size Partition Partition_unalive Replica Offline_path Offline_format Offline_deep_copy
---------- ------------ --------------- -------------- ------ ------------------ ---------------- ----------- ------------------- --------- -------------- ---------------- -------------------
6 t1 db memory 2 479 0 8 0 3 NULL NULL NULL
---------- ------------ --------------- -------------- ------ ------------------ ---------------- ----------- ------------------- --------- -------------- ---------------- -------------------
```

0 comments on commit 866f3f3

Please sign in to comment.