diff --git a/docs/en/05-basic/01-model.md b/docs/en/05-basic/01-model.md index 5d82b03d51..f9bf0553d4 100644 --- a/docs/en/05-basic/01-model.md +++ b/docs/en/05-basic/01-model.md @@ -6,8 +6,6 @@ slug: /basic-features/data-model import Image from '@theme/IdealImage'; import dataModel from '../assets/data-model-01.png'; -import origintable from '../assets/data-model-origin-table.png'; -import origintable2 from '../assets/data-model-origin-table-2.png'; To clearly explain the concepts of time-series data and facilitate the writing of example programs, the TDengine documentation uses smart meters as an example. These example smart meters can collect three metrics: current, voltage, and phase. In addition, each smart meter also has two static attributes: location and group ID. The data collected by these smart meters is shown in the table below. @@ -370,7 +368,63 @@ TAGS ( Taking device d1001 as an example, assume that the current, voltage, and phase data of device d1001 are as follows: -data-model-origin-table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
current_d1001voltage_d1001phase_d1001
TimestampCurrentTimestampVoltageTimestampPhase
153854868500010.3153854868500021915385486850000.31
153854869500012.6153854869500021815385486950000.33
153854869680012.3153854869680022115385486968000.31
153854869710012.1153854869710022015385486972000.32
153854869770011.8153854869780022215385486978000.33
| Timestamp | Current | Voltage | Phase | |-------------------|---------|---------|-------| @@ -399,7 +453,78 @@ CREATE VTABLE current_v ( ``` Assume that the current data of devices d1001, d1002, d1003, and d1004 are as follows: -data-model-origin-table-2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
d1001d1002d1003d1004
TimestampCurrentTimestampCurrentTimestampCurrentTimestampCurrent
153854868500010.3153854868500011.7153854868500011.2153854868500012.4
153854869500012.6153854869500011.9153854869500010.8153854869500011.3
153854869680012.3153854869680012.4153854869680012.3153854869680010.1
153854869710012.1153854869720012.2153854869710011.1153854869720011.7
153854869770011.8153854869770011.4153854869780012.1153854869780012.6
The virtual table `current_v` aligns current data by timestamp: diff --git a/docs/en/14-reference/03-taos-sql/05-virtualtable.md b/docs/en/14-reference/03-taos-sql/05-virtualtable.md index 4aa1c99719..b1ddd7e7e3 100644 --- a/docs/en/14-reference/03-taos-sql/05-virtualtable.md +++ b/docs/en/14-reference/03-taos-sql/05-virtualtable.md @@ -4,10 +4,6 @@ title: Virtual Tables description: Various management operations for virtual tables --- -import origintable from './assets/virtual-table-origin-table.png'; -import queryres from './assets/virtual-table-query-res.png'; -import partres from './assets/virtual-table-query-res-part.png'; - ## Create Virtual Table The `CREATE VTABLE` statement is used to create virtual basic tables and virtual subtables using virtual supertables as templates. @@ -74,7 +70,68 @@ Virtual tables use the same query syntax as regular tables, but their dataset ma Given tables t1, t2, t3 with data: -Original Table Structure and Data + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
t1t2t3
tsvaluetsvaluetsvalue1value2
0:00:011
0:00:0220
0:00:033003000
0:00:0440:00:04400:00:03
0:00:05500:00:055005000
Create a virtual table v1: @@ -94,7 +151,54 @@ SELECT * FROM v1; ``` Result: -Full Query Result + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
v1
tsc1c2c3c4
0:00:011
0:00:0220
0:00:033003000
0:00:04440
0:00:05505005000
Partial column query: @@ -103,7 +207,37 @@ SELECT c1, c2 FROM v1; ``` Result: -Partial Query Result + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
v1
tsc1c2
0:00:011
0:00:0220
0:00:04440
0:00:0550
Since the original tables t1 and t2 (corresponding to columns c1 and c2) lack the timestamp 0:00:03, this timestamp will not appear in the final result. @@ -243,7 +377,7 @@ privileges: { ALL | READ | WRITE } #### Revoke ```sql REVOKE privileges ON [db_name.]vtable_name FROM user_name -privileges: { ALL | READ | WRITE } + privileges: { ALL | READ | WRITE } ``` ### Permission Rules diff --git a/docs/en/14-reference/03-taos-sql/assets/virtual-table-origin-table.png b/docs/en/14-reference/03-taos-sql/assets/virtual-table-origin-table.png deleted file mode 100644 index 4819389b22..0000000000 Binary files a/docs/en/14-reference/03-taos-sql/assets/virtual-table-origin-table.png and /dev/null differ diff --git a/docs/en/14-reference/03-taos-sql/assets/virtual-table-query-res-part.png b/docs/en/14-reference/03-taos-sql/assets/virtual-table-query-res-part.png deleted file mode 100644 index 5afbdac55e..0000000000 Binary files a/docs/en/14-reference/03-taos-sql/assets/virtual-table-query-res-part.png and /dev/null differ diff --git a/docs/en/14-reference/03-taos-sql/assets/virtual-table-query-res.png b/docs/en/14-reference/03-taos-sql/assets/virtual-table-query-res.png deleted file mode 100644 index d32e15cb3f..0000000000 Binary files a/docs/en/14-reference/03-taos-sql/assets/virtual-table-query-res.png and /dev/null differ diff --git a/docs/en/assets/data-model-origin-table-2.png b/docs/en/assets/data-model-origin-table-2.png deleted file mode 100644 index 8d0e203b4e..0000000000 Binary files a/docs/en/assets/data-model-origin-table-2.png and /dev/null differ diff --git a/docs/en/assets/data-model-origin-table.png b/docs/en/assets/data-model-origin-table.png deleted file mode 100644 index 4e128e26b0..0000000000 Binary files a/docs/en/assets/data-model-origin-table.png and /dev/null differ diff --git a/docs/zh/05-basic/01-model.md b/docs/zh/05-basic/01-model.md index 2c311f1010..dff026a6a6 100644 --- a/docs/zh/05-basic/01-model.md +++ b/docs/zh/05-basic/01-model.md @@ -3,8 +3,6 @@ sidebar_label: 数据模型 title: TDengine 数据模型 toc_max_heading_level: 4 --- -import origintable from './data-model-origin-table.png'; -import origintable2 from './data-model-origin-table-2.png'; 为了清晰地阐述时序数据的基本概念,并为示例程序的编写提供便利,整个文档都将以智能电表为例,探讨时序数据的典型应用场景。设想有一种型号的智能电表,它能够采集 电流、电压和相位这 3 个模拟量。此外,每块智能电表还具有位置和分组等静态属性。这些智能电表采集的数据示例如下表所示。 @@ -357,7 +355,63 @@ TAGS ( 以设备 d1001 为例,假设 d1001 设备的电流、电压、相位数据如下: -data-model-origin-table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
current_d1001voltage_d1001phase_d1001
TimestampCurrentTimestampVoltageTimestampPhase
153854868500010.3153854868500021915385486850000.31
153854869500012.6153854869500021815385486950000.33
153854869680012.3153854869680022115385486968000.31
153854869710012.1153854869710022015385486972000.32
153854869770011.8153854869780022215385486978000.33
虚拟表 d1001_v 中的数据如下: @@ -390,7 +444,77 @@ CREATE VTABLE current_v ( 假设 d1001, d1002, d1003, d1004 四个设备的电流数据如下: -data-model-origin-table-2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
d1001d1002d1003d1004
TimestampCurrentTimestampCurrentTimestampCurrentTimestampCurrent
153854868500010.3153854868500011.7153854868500011.2153854868500012.4
153854869500012.6153854869500011.9153854869500010.8153854869500011.3
153854869680012.3153854869680012.4153854869680012.3153854869680010.1
153854869710012.1153854869720012.2153854869710011.1153854869720011.7
153854869770011.8153854869770011.4153854869780012.1153854869780012.6
虚拟表 current_v 中的数据如下: diff --git a/docs/zh/05-basic/data-model-origin-table-2.png b/docs/zh/05-basic/data-model-origin-table-2.png deleted file mode 100644 index 8d0e203b4e..0000000000 Binary files a/docs/zh/05-basic/data-model-origin-table-2.png and /dev/null differ diff --git a/docs/zh/05-basic/data-model-origin-table.png b/docs/zh/05-basic/data-model-origin-table.png deleted file mode 100644 index 4e128e26b0..0000000000 Binary files a/docs/zh/05-basic/data-model-origin-table.png and /dev/null differ diff --git a/docs/zh/14-reference/03-taos-sql/05-virtualtable.md b/docs/zh/14-reference/03-taos-sql/05-virtualtable.md index 2b354fd3c1..9061511829 100644 --- a/docs/zh/14-reference/03-taos-sql/05-virtualtable.md +++ b/docs/zh/14-reference/03-taos-sql/05-virtualtable.md @@ -4,10 +4,6 @@ title: 虚拟表 description: 对虚拟表的各种管理操作 --- -import origintable from './pic/virtual-table-origin-table.png'; -import queryres from './pic/virtual-table-query-res.png'; -import partres from './pic/virtual-table-query-res-part.png'; - ## 创建虚拟表 `CREATE VTABLE` 语句用于创建普通虚拟表和以虚拟超级表为模板创建虚拟子表。 @@ -73,7 +69,68 @@ CREATE VTABLE [IF NOT EXISTS] [db_name].vtb_name 假设有表 t1、t2、t3 结构和数据如下: -origintable + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
t1t2t3
tsvaluetsvaluetsvalue1value2
0:00:011
0:00:0220
0:00:033003000
0:00:0440:00:04400:00:03
0:00:05500:00:055005000
并且有虚拟普通表 v1 ,创建方式如下: @@ -94,7 +151,53 @@ select * from v1; 结果如下: -queryres + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
v1
tsc1c2c3c4
0:00:011
0:00:0220
0:00:033003000
0:00:04440
0:00:05505005000
如果没有选择全部列,只是选择了部分列,查询的结果只会包含选择的列的原始表的时间戳,例如执行如下查询: @@ -104,7 +207,36 @@ select c1, c2 from v1; 得到的结果如下图所示: -partres + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
v1
tsc1c2
0:00:011
0:00:0220
0:00:04440
0:00:0550
因为 c1、c2 列对应的原始表 t1、t2 中没有 0:00:03 这个时间戳,所以最后的结果也不会包含这个时间戳。 diff --git a/docs/zh/14-reference/03-taos-sql/pic/virtual-table-origin-table.png b/docs/zh/14-reference/03-taos-sql/pic/virtual-table-origin-table.png deleted file mode 100644 index 4819389b22..0000000000 Binary files a/docs/zh/14-reference/03-taos-sql/pic/virtual-table-origin-table.png and /dev/null differ diff --git a/docs/zh/14-reference/03-taos-sql/pic/virtual-table-query-res-part.png b/docs/zh/14-reference/03-taos-sql/pic/virtual-table-query-res-part.png deleted file mode 100644 index 5afbdac55e..0000000000 Binary files a/docs/zh/14-reference/03-taos-sql/pic/virtual-table-query-res-part.png and /dev/null differ diff --git a/docs/zh/14-reference/03-taos-sql/pic/virtual-table-query-res.png b/docs/zh/14-reference/03-taos-sql/pic/virtual-table-query-res.png deleted file mode 100644 index d32e15cb3f..0000000000 Binary files a/docs/zh/14-reference/03-taos-sql/pic/virtual-table-query-res.png and /dev/null differ