Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1532,10 +1532,10 @@ The `iotdb-system.properties` file contains various configurations for managing
- slow_query_threshold

| Name | slow_query_threshold |
| ----------- | -------------------------------------- |
| ----------- |----------------------------------------|
| Description | Time cost(ms) threshold for slow query |
| Type | long |
| Default | 10000 |
| Default | 3000 |
| Effective | Hot reload |

- query_cost_stat_window
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1533,10 +1533,10 @@ The `iotdb-system.properties` file contains various configurations for managing
- slow_query_threshold

| Name | slow_query_threshold |
| ----------- | -------------------------------------- |
| ----------- |----------------------------------------|
| Description | Time cost(ms) threshold for slow query |
| Type | long |
| Default | 10000 |
| Default | 3000 |
| Effective | Hot reload |

- query_cost_stat_window
Expand Down
62 changes: 46 additions & 16 deletions src/UserGuide/Master/Table/Reference/System-Tables_apache.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@

IoTDB has a built-in system database called `INFORMATION_SCHEMA`, which contains a series of system tables for storing IoTDB runtime information (such as currently executing SQL statements, etc.). Currently, the `INFORMATION_SCHEMA` database only supports read operations.

> 💡 **[V2.0.8-beta Version Update]**<br>
> 👉 Added four system tables: **[CONNECTIONS](#_2-18-connections)** (real-time connection tracking), **[CURRENT_QUERIES](#_2-19-current-queries)** (active query monitoring), **[QUERIES_COSTS_HISTOGRAM](#_2-20-queries-costs-histogram)** (query latency distribution), **[SERVICES](#_2-21-services)** (service status management), enhancing cluster maintenance and performance analysis.


## 1. System Database

* ​**Name**​: `INFORMATION_SCHEMA`
Expand Down Expand Up @@ -57,6 +61,7 @@ IoTDB> show tables from information_schema
| queries| INF|
|queries_costs_histogram| INF|
| regions| INF|
| services| INF|
| subscriptions| INF|
| tables| INF|
| topics| INF|
Expand All @@ -66,7 +71,7 @@ IoTDB> show tables from information_schema

## 2. System Tables

* ​**Names**​: `DATABASES`, `TABLES`, `REGIONS`, `QUERIES`, `COLUMNS`, `PIPES`, `PIPE_PLUGINS`, `SUBSCRIPTION`, `TOPICS`, `VIEWS`, `MODELS`, `FUNCTIONS`, `CONFIGURATIONS`, `KEYWORDS`, `NODES`, `CONFIG_NODES`, `DATA_NODES` , `CONNECTIONS`, `CURRENT_QUERIES`, `QUERIES_COSTS_HISTOGRAM` (detailed descriptions in later sections)
* ​**Names**​: `DATABASES`, `TABLES`, `REGIONS`, `QUERIES`, `COLUMNS`, `PIPES`, `PIPE_PLUGINS`, `SUBSCRIPTION`, `TOPICS`, `VIEWS`, `MODELS`, `FUNCTIONS`, `CONFIGURATIONS`, `KEYWORDS`, `NODES`, `CONFIG_NODES`, `DATA_NODES` , `CONNECTIONS`, `CURRENT_QUERIES`, `QUERIES_COSTS_HISTOGRAM`, `SERVICES` (detailed descriptions in later sections)
* ​**Operations**​: Read-only, only supports `SELECT`, `COUNT/SHOW DEVICES`, `DESC`. Any modifications to table structure or content are not allowed and will result in an error: `"The database 'information_schema' can only be queried." `
* ​**Column Names**​: System table column names are all lowercase by default and separated by underscores (`_`).

Expand Down Expand Up @@ -343,7 +348,7 @@ IoTDB> select * from information_schema.topics
+----------+----------------------------------------------------------------+
```

### 2.10 VIEWS Table
### 2.10 VIEWS

> This system table is available starting from version V2.0.5.

Expand All @@ -369,9 +374,9 @@ IoTDB> select * from information_schema.views
```


### 2.11 MODELS Table
### 2.11 MODELS

> This system table is available starting from version V 2.0.5 and has been discontinued since version V 2.0.8.
> This system table is available starting from version V 2.0.5 and has been discontinued since version V 2.0.8-beta.

* Contains information about all models in the database.
* The table structure is as follows:
Expand Down Expand Up @@ -402,7 +407,7 @@ IoTDB> select * from information_schema.models where model_type = 'BUILT_IN_FORE
```


### 2.12 FUNCTIONS Table
### 2.12 FUNCTIONS

> This system table is available starting from version V2.0.5.

Expand Down Expand Up @@ -434,7 +439,7 @@ IoTDB> select * from information_schema.functions where function_type='built-in
```


### 2.13 CONFIGURATIONS Table
### 2.13 CONFIGURATIONS

> This system table is available starting from version V2.0.5.

Expand Down Expand Up @@ -473,7 +478,7 @@ IoTDB> select * from information_schema.configurations
```


### 2.14 KEYWORDS Table
### 2.14 KEYWORDS

> This system table is available starting from version V2.0.5.

Expand Down Expand Up @@ -506,7 +511,7 @@ IoTDB> select * from information_schema.keywords limit 10
```


### 2.15 NODES Table
### 2.15 NODES

> This system table is available starting from version V2.0.5.

Expand Down Expand Up @@ -538,7 +543,7 @@ IoTDB> select * from information_schema.nodes
```


### 2.16 CONFIG\_NODES Table
### 2.16 CONFIG\_NODES

> This system table is available starting from version V2.0.5.

Expand All @@ -564,7 +569,7 @@ IoTDB> select * from information_schema.config_nodes
```


### 2.17 DATA\_NODES Table
### 2.17 DATA\_NODES

> This system table is available starting from version V2.0.5.

Expand Down Expand Up @@ -594,9 +599,9 @@ IoTDB> select * from information_schema.data_nodes
+-------+---------------+-----------------+-----------+--------+--------+-------------------+---------------------+
```

### 2.18 CONNECTIONS Table
### 2.18 CONNECTIONS

> This system table is available starting from version V 2.0.8
> This system table is available starting from version V 2.0.8-beta

* Contains all connections in the cluster.
* The table structure is as follows:
Expand All @@ -621,9 +626,9 @@ IoTDB> select * from information_schema.connections;
+-----------+-------+----------+---------+-----------------------------+---------+
```

### 2.19 CURRENT_QUERIES Table
### 2.19 CURRENT_QUERIES

> This system table is available starting from version V 2.0.8
> This system table is available starting from version V 2.0.8-beta

* Contains all queries whose execution end time falls within the range `[now() - query_cost_stat_window, now())`, including currently executing queries. The `query_cost_stat_window` parameter represents the query cost statistics window. Its default value is 0 and can be configured via the `iotdb-system.properties` configuration file.
* The table structure is as follows:
Expand Down Expand Up @@ -652,9 +657,9 @@ IoTDB> select * from information_schema.current_queries;
+-----------------------+-------+-----------------------------+--------+-----------+---------+------------------------------------------------+----+---------+
```

### 2.20 QUERIES_COSTS_HISTOGRAM Table
### 2.20 QUERIES_COSTS_HISTOGRAM

> This system table is available starting from version V 2.0.8
> This system table is available starting from version V 2.0.8-beta

* Contains a histogram of query execution times within the past `query_cost_stat_window` period (only statistics for completed SQL queries). The `query_cost_stat_window` parameter represents the query cost statistics window. Its default value is 0 and can be configured via the `iotdb-system.properties` configuration file.
* The table structure is as follows:
Expand Down Expand Up @@ -686,6 +691,31 @@ IoTDB> select * from information_schema.queries_costs_histogram limit 10
+------+----+-----------+
```

### 2.21 SERVICES

> This system table is available starting from version V 2.0.8-beta

* Displays services (MQTT service, REST service) on all active DataNodes (with RUNNING or READ-ONLY status).
* Table structure:

| Column Name | Data Type | Column Type | Description |
|---------------|-----------|-------------|---------------------------------|
| service_name | STRING | TAG | Service Name |
| datanode_id | INT32 | ATTRIBUTE | DataNode ID where service runs |
| state | STRING | ATTRIBUTE | Service status: RUNNING/STOPPED |


* Query example:

```sql
IoTDB> SELECT * FROM information_schema.services
+------------+-----------+---------+
|service_name|datanode_id|state |
+------------+-----------+---------+
|MQTT |1 |STOPPED |
|REST |1 |RUNNING |
+------------+-----------+---------+
```

## 3. Permission Description

Expand Down
55 changes: 43 additions & 12 deletions src/UserGuide/Master/Table/Reference/System-Tables_timecho.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@

IoTDB has a built-in system database called `INFORMATION_SCHEMA`, which contains a series of system tables for storing IoTDB runtime information (such as currently executing SQL statements, etc.). Currently, the `INFORMATION_SCHEMA` database only supports read operations.

> 💡 **[V2.0.8 Version Update]**<br>
> 👉 Added four system tables: **[CONNECTIONS](#_2-18-connections)** (real-time connection tracking), **[CURRENT_QUERIES](#_2-19-current-queries)** (active query monitoring), **[QUERIES_COSTS_HISTOGRAM](#_2-20-queries-costs-histogram)** (query latency distribution), **[SERVICES](#_2-21-services)** (service status management), enhancing cluster maintenance and performance analysis.


## 1. System Database

* ​**Name**​: `INFORMATION_SCHEMA`
Expand Down Expand Up @@ -57,6 +61,7 @@ IoTDB> show tables from information_schema
| queries| INF|
|queries_costs_histogram| INF|
| regions| INF|
| services| INF|
| subscriptions| INF|
| tables| INF|
| topics| INF|
Expand All @@ -66,7 +71,7 @@ IoTDB> show tables from information_schema

## 2. System Tables

* ​**Names**​: `DATABASES`, `TABLES`, `REGIONS`, `QUERIES`, `COLUMNS`, `PIPES`, `PIPE_PLUGINS`, `SUBSCRIPTION`, `TOPICS`, `VIEWS`, `MODELS`, `FUNCTIONS`, `CONFIGURATIONS`, `KEYWORDS`, `NODES`, `CONFIG_NODES`, `DATA_NODES`, `CONNECTIONS`, `CURRENT_QUERIES`, `QUERIES_COSTS_HISTOGRAM` (detailed descriptions in later sections)
* ​**Names**​: `DATABASES`, `TABLES`, `REGIONS`, `QUERIES`, `COLUMNS`, `PIPES`, `PIPE_PLUGINS`, `SUBSCRIPTION`, `TOPICS`, `VIEWS`, `MODELS`, `FUNCTIONS`, `CONFIGURATIONS`, `KEYWORDS`, `NODES`, `CONFIG_NODES`, `DATA_NODES`, `CONNECTIONS`, `CURRENT_QUERIES`, `QUERIES_COSTS_HISTOGRAM`, `SERVICES` (detailed descriptions in later sections)
* ​**Operations**​: Read-only, only supports `SELECT`, `COUNT/SHOW DEVICES`, `DESC`. Any modifications to table structure or content are not allowed and will result in an error: `"The database 'information_schema' can only be queried." `
* ​**Column Names**​: System table column names are all lowercase by default and separated by underscores (`_`).

Expand Down Expand Up @@ -343,7 +348,7 @@ IoTDB> select * from information_schema.topics
+----------+----------------------------------------------------------------+
```

### 2.10 VIEWS Table
### 2.10 VIEWS

> This system table is available starting from version V2.0.5.

Expand All @@ -369,7 +374,7 @@ IoTDB> select * from information_schema.views
```


### 2.11 MODELS Table
### 2.11 MODELS

> This system table is available starting from version V 2.0.5 and has been discontinued since version V 2.0.8.

Expand Down Expand Up @@ -402,7 +407,7 @@ IoTDB> select * from information_schema.models where model_type = 'BUILT_IN_FORE
```


### 2.12 FUNCTIONS Table
### 2.12 FUNCTIONS

> This system table is available starting from version V2.0.5.

Expand Down Expand Up @@ -434,7 +439,7 @@ IoTDB> select * from information_schema.functions where function_type='built-in
```


### 2.13 CONFIGURATIONS Table
### 2.13 CONFIGURATIONS

> This system table is available starting from version V2.0.5.

Expand Down Expand Up @@ -473,7 +478,7 @@ IoTDB> select * from information_schema.configurations
```


### 2.14 KEYWORDS Table
### 2.14 KEYWORDS

> This system table is available starting from version V2.0.5.

Expand Down Expand Up @@ -506,7 +511,7 @@ IoTDB> select * from information_schema.keywords limit 10
```


### 2.15 NODES Table
### 2.15 NODES

> This system table is available starting from version V2.0.5.

Expand Down Expand Up @@ -538,7 +543,7 @@ IoTDB> select * from information_schema.nodes
```


### 2.16 CONFIG\_NODES Table
### 2.16 CONFIG\_NODES

> This system table is available starting from version V2.0.5.

Expand All @@ -564,7 +569,7 @@ IoTDB> select * from information_schema.config_nodes
```


### 2.17 DATA\_NODES Table
### 2.17 DATA\_NODES

> This system table is available starting from version V2.0.5.

Expand Down Expand Up @@ -594,7 +599,7 @@ IoTDB> select * from information_schema.data_nodes
+-------+---------------+-----------------+-----------+--------+--------+-------------------+---------------------+
```

### 2.18 CONNECTIONS Table
### 2.18 CONNECTIONS

> This system table is available starting from version V 2.0.8

Expand All @@ -621,7 +626,7 @@ IoTDB> select * from information_schema.connections;
+-----------+-------+----------+---------+-----------------------------+---------+
```

### 2.19 CURRENT_QUERIES Table
### 2.19 CURRENT_QUERIES

> This system table is available starting from version V 2.0.8

Expand Down Expand Up @@ -652,7 +657,7 @@ IoTDB> select * from information_schema.current_queries;
+-----------------------+-------+-----------------------------+--------+-----------+---------+------------------------------------------------+----+---------+
```

### 2.20 QUERIES_COSTS_HISTOGRAM Table
### 2.20 QUERIES_COSTS_HISTOGRAM

> This system table is available starting from version V 2.0.8

Expand Down Expand Up @@ -686,6 +691,32 @@ IoTDB> select * from information_schema.queries_costs_histogram limit 10
+------+----+-----------+
```

### 2.21 SERVICES

> This system table is available starting from version V 2.0.8

* Displays services (MQTT service, REST service) on all active DataNodes (with RUNNING or READ-ONLY status).
* Table structure:

| Column Name | Data Type | Column Type | Description |
|---------------|-----------|-------------|---------------------------------|
| service_name | STRING | TAG | Service Name |
| datanode_id | INT32 | ATTRIBUTE | DataNode ID where service runs |
| state | STRING | ATTRIBUTE | Service status: RUNNING/STOPPED |


* Query example:

```sql
IoTDB> SELECT * FROM information_schema.services
+------------+-----------+---------+
|service_name|datanode_id|state |
+------------+-----------+---------+
|MQTT |1 |STOPPED |
|REST |1 |RUNNING |
+------------+-----------+---------+
```


## 3. Permission Description

Expand Down
Loading